mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-30 21:55:31 +00:00
Merge m-c to s-c.
This commit is contained in:
commit
6ec3002445
@ -396,20 +396,21 @@ nsRootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
|
||||
targetNode->AsElement()->NodeInfo()->Equals(nsGkAtoms::tree,
|
||||
kNameSpaceID_XUL)) {
|
||||
treeAcc = do_QueryObject(accessible);
|
||||
if (treeAcc) {
|
||||
if (eventType.EqualsLiteral("TreeViewChanged")) {
|
||||
treeAcc->TreeViewChanged();
|
||||
return;
|
||||
}
|
||||
|
||||
if (eventType.EqualsLiteral("TreeViewChanged")) {
|
||||
treeAcc->TreeViewChanged();
|
||||
return;
|
||||
}
|
||||
if (eventType.EqualsLiteral("TreeRowCountChanged")) {
|
||||
HandleTreeRowCountChangedEvent(aDOMEvent, treeAcc);
|
||||
return;
|
||||
}
|
||||
|
||||
if (eventType.EqualsLiteral("TreeRowCountChanged")) {
|
||||
HandleTreeRowCountChangedEvent(aDOMEvent, treeAcc);
|
||||
return;
|
||||
}
|
||||
|
||||
if (eventType.EqualsLiteral("TreeInvalidated")) {
|
||||
HandleTreeInvalidatedEvent(aDOMEvent, treeAcc);
|
||||
return;
|
||||
if (eventType.EqualsLiteral("TreeInvalidated")) {
|
||||
HandleTreeInvalidatedEvent(aDOMEvent, treeAcc);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -96,7 +96,7 @@
|
||||
this.invoke = function removeTextData_invoke()
|
||||
{
|
||||
var tree = {
|
||||
role: ROLE_SECTION,
|
||||
role: ROLE_PARAGRAPH,
|
||||
children: [
|
||||
{
|
||||
role: ROLE_TEXT_LEAF,
|
||||
@ -112,7 +112,7 @@
|
||||
this.finalCheck = function removeTextData_finalCheck()
|
||||
{
|
||||
var tree = {
|
||||
role: ROLE_SECTION,
|
||||
role: ROLE_PARAGRAPH,
|
||||
children: []
|
||||
};
|
||||
testAccessibleTree(this.containerNode, tree);
|
||||
@ -147,7 +147,8 @@
|
||||
gQueue.push(new setOnClickNRoleAttrs("span"));
|
||||
|
||||
// text data removal of text node should remove its text accessible
|
||||
gQueue.push(new removeTextData("container2"));
|
||||
gQueue.push(new removeTextData("p"));
|
||||
gQueue.push(new removeTextData("pre"));
|
||||
|
||||
gQueue.invoke(); // SimpleTest.finish() will be called in the end
|
||||
}
|
||||
@ -168,6 +169,11 @@
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=625652">
|
||||
Mozilla Bug 625652
|
||||
</a>
|
||||
<a target="_blank"
|
||||
title="Remove text accesible getting no text inside a preformatted area"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=706335">
|
||||
Mozilla Bug 706335
|
||||
</a>
|
||||
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
@ -179,7 +185,8 @@
|
||||
<span id="span">span</span>
|
||||
</div>
|
||||
|
||||
<div id="container2">text</div>
|
||||
<p id="p">text</p>
|
||||
<pre id="pre">text</pre>
|
||||
|
||||
<div id="eventdump"></div>
|
||||
</body>
|
||||
|
@ -203,7 +203,7 @@ pref("app.update.incompatible.mode", 0);
|
||||
// .. etc ..
|
||||
//
|
||||
pref("extensions.update.enabled", true);
|
||||
pref("extensions.update.url", "https://versioncheck.addons.mozilla.org/update/VersionCheck.php?reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=%APP_VERSION%&appOS=%APP_OS%&appABI=%APP_ABI%&locale=%APP_LOCALE%¤tAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%");
|
||||
pref("extensions.update.url", "https://versioncheck.addons.mozilla.org/update/VersionCheck.php?reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=%APP_VERSION%&appOS=%APP_OS%&appABI=%APP_ABI%&locale=%APP_LOCALE%¤tAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%");
|
||||
pref("extensions.update.interval", 86400); // Check for updates to Extensions and
|
||||
// Themes every day
|
||||
// Non-symmetric (not shared by extensions) extension-specific [update] preferences
|
||||
|
@ -208,6 +208,7 @@ let TabView = {
|
||||
this._iframe = document.createElement("iframe");
|
||||
this._iframe.id = "tab-view";
|
||||
this._iframe.setAttribute("transparent", "true");
|
||||
this._iframe.setAttribute("tooltip", "tab-view-tooltip");
|
||||
this._iframe.flex = 1;
|
||||
|
||||
let self = this;
|
||||
@ -235,6 +236,12 @@ let TabView = {
|
||||
|
||||
this._iframe.setAttribute("src", "chrome://browser/content/tabview.html");
|
||||
this._deck.appendChild(this._iframe);
|
||||
|
||||
// ___ create tooltip
|
||||
let tooltip = document.createElement("tooltip");
|
||||
tooltip.id = "tab-view-tooltip";
|
||||
tooltip.setAttribute("onpopupshowing", "return TabView.fillInTooltip(document.tooltipNode);");
|
||||
document.getElementById("mainPopupSet").appendChild(tooltip);
|
||||
},
|
||||
|
||||
// ----------
|
||||
@ -353,8 +360,10 @@ let TabView = {
|
||||
if (!tabItem)
|
||||
return;
|
||||
|
||||
// Switch to the new tab
|
||||
window.gBrowser.selectedTab = tabItem.tab;
|
||||
if (gBrowser.selectedTab.pinned)
|
||||
groupItems.updateActiveGroupItemAndTabBar(tabItem, {dontSetActiveTabInGroup: true});
|
||||
else
|
||||
gBrowser.selectedTab = tabItem.tab;
|
||||
});
|
||||
}
|
||||
}, true);
|
||||
@ -440,5 +449,29 @@ let TabView = {
|
||||
// show banner
|
||||
this._window.UI.notifySessionRestoreEnabled();
|
||||
}
|
||||
},
|
||||
|
||||
// ----------
|
||||
// Function: fillInTooltip
|
||||
// Fills in the tooltip text.
|
||||
fillInTooltip: function fillInTooltip(tipElement) {
|
||||
let retVal = false;
|
||||
let titleText = null;
|
||||
let direction = tipElement.ownerDocument.dir;
|
||||
|
||||
while (!titleText && tipElement) {
|
||||
if (tipElement.nodeType == Node.ELEMENT_NODE)
|
||||
titleText = tipElement.getAttribute("title");
|
||||
tipElement = tipElement.parentNode;
|
||||
}
|
||||
let tipNode = document.getElementById("tab-view-tooltip");
|
||||
tipNode.style.direction = direction;
|
||||
|
||||
if (titleText) {
|
||||
tipNode.setAttribute("label", titleText);
|
||||
retVal = true;
|
||||
}
|
||||
|
||||
return retVal;
|
||||
}
|
||||
};
|
||||
|
@ -48,8 +48,6 @@ _TEST_FILES = \
|
||||
feed_discovery.html \
|
||||
test_bug395533.html \
|
||||
bug395533-data.txt \
|
||||
test_contextmenu.html \
|
||||
subtst_contextmenu.html \
|
||||
ctxmenu-image.png \
|
||||
video.ogg \
|
||||
test_offlineNotification.html \
|
||||
@ -72,6 +70,14 @@ _TEST_FILES = \
|
||||
gZipOfflineChild.cacheManifest^headers^ \
|
||||
$(NULL)
|
||||
|
||||
# test_contextmenu.html is disabled on Linux due to bug 513558
|
||||
ifneq (gtk2,$(MOZ_WIDGET_TOOLKIT))
|
||||
_TEST_FILES += \
|
||||
test_contextmenu.html \
|
||||
subtst_contextmenu.html \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
# The following tests are disabled because they are unreliable:
|
||||
# browser_bug423833.js is bug 428712
|
||||
# browser_sanitize-download-history.js is bug 432425
|
||||
|
@ -1,6 +1,7 @@
|
||||
function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
ignoreAllUncaughtExceptions();
|
||||
var frame = document.getElementById("customizeToolbarSheetIFrame");
|
||||
frame.addEventListener("load", testCustomizeFrameLoadedPre, true);
|
||||
|
||||
|
@ -51,9 +51,6 @@
|
||||
#define NS_OPERAPROFILEMIGRATOR_CID \
|
||||
{ 0xf34ff792, 0x722e, 0x4490, { 0xb1, 0x95, 0x47, 0xd2, 0x42, 0xed, 0xca, 0x1c } }
|
||||
|
||||
#define NS_SEAMONKEYPROFILEMIGRATOR_CID \
|
||||
{ 0x9a28ffa7, 0xe6ef, 0x4b52, { 0xa1, 0x27, 0x6a, 0xd9, 0x51, 0xde, 0x8e, 0x9b } }
|
||||
|
||||
#define NS_SHELLSERVICE_CID \
|
||||
{ 0x63c7b9f4, 0xcc8, 0x43f8, { 0xb6, 0x66, 0xa, 0x66, 0x16, 0x55, 0xcb, 0x73 } }
|
||||
|
||||
|
@ -186,8 +186,8 @@ var MigrationWizard = {
|
||||
this._wiz.currentPage.next = "importItems";
|
||||
|
||||
var sourceProfiles = this._migrator.sourceProfiles;
|
||||
if (sourceProfiles && sourceProfiles.Count() == 1) {
|
||||
var profileName = sourceProfiles.QueryElementAt(0, Components.interfaces.nsISupportsString);
|
||||
if (sourceProfiles && sourceProfiles.length == 1) {
|
||||
var profileName = sourceProfiles.queryElementAt(0, Ci.nsISupportsString);
|
||||
this._selectedProfile = profileName.data;
|
||||
}
|
||||
else
|
||||
@ -211,10 +211,9 @@ var MigrationWizard = {
|
||||
// and we canceled the dialog. When that happens, _migrator will be null.
|
||||
if (this._migrator) {
|
||||
var sourceProfiles = this._migrator.sourceProfiles;
|
||||
var count = sourceProfiles.Count();
|
||||
for (var i = 0; i < count; ++i) {
|
||||
for (var i = 0; i < sourceProfiles.length; ++i) {
|
||||
var item = document.createElement("radio");
|
||||
var str = sourceProfiles.QueryElementAt(i, Components.interfaces.nsISupportsString);
|
||||
var str = sourceProfiles.queryElementAt(i, Ci.nsISupportsString);
|
||||
item.id = str.data;
|
||||
item.setAttribute("label", str.data);
|
||||
profiles.appendChild(item);
|
||||
|
@ -36,10 +36,10 @@
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
interface nsISupportsArray;
|
||||
interface nsIArray;
|
||||
interface nsIProfileStartup;
|
||||
|
||||
[scriptable, uuid(f8365b4a-da55-4e47-be7a-230142360f62)]
|
||||
[scriptable, uuid(5f445759-86a8-4dd3-ab84-4fc5341d9d9d)]
|
||||
interface nsIBrowserProfileMigrator : nsISupports
|
||||
{
|
||||
/**
|
||||
@ -68,7 +68,8 @@ interface nsIBrowserProfileMigrator : nsISupports
|
||||
* @param aProfile the profile that we are looking for available data
|
||||
* to import
|
||||
* @param aDoingStartup "true" if the profile is not currently being used.
|
||||
* @returns bit field containing profile items (see above)
|
||||
* @return bit field containing profile items (see above)
|
||||
* @note a return value of 0 represents no items rather than ALL.
|
||||
*/
|
||||
unsigned short getMigrateData(in wstring aProfile, in boolean aDoingStartup);
|
||||
|
||||
@ -89,8 +90,8 @@ interface nsIBrowserProfileMigrator : nsISupports
|
||||
* An enumeration of available profiles. If the import source does
|
||||
* not support profiles, this attribute is null.
|
||||
*/
|
||||
readonly attribute nsISupportsArray sourceProfiles;
|
||||
|
||||
readonly attribute nsIArray sourceProfiles;
|
||||
|
||||
/**
|
||||
* The import source homepage. Returns null if not present/available
|
||||
*/
|
||||
|
@ -39,6 +39,7 @@
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cu = Components.utils;
|
||||
const Cr = Components.results;
|
||||
|
||||
const LOCAL_FILE_CID = "@mozilla.org/file/local;1";
|
||||
const FILE_INPUT_STREAM_CID = "@mozilla.org/network/file-input-stream;1";
|
||||
@ -72,7 +73,7 @@ XPCOMUtils.defineLazyGetter(this, "bookmarksSubfolderTitle", function () {
|
||||
1);
|
||||
});
|
||||
|
||||
/*
|
||||
/**
|
||||
* Convert Chrome time format to Date object
|
||||
*
|
||||
* @param aTime
|
||||
@ -86,7 +87,7 @@ function chromeTimeToDate(aTime)
|
||||
return new Date((aTime * S100NS_PER_MS - S100NS_FROM1601TO1970 ) / 10000);
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Insert bookmark items into specific folder.
|
||||
*
|
||||
* @param aFolderId
|
||||
@ -129,25 +130,38 @@ ChromeProfileMigrator.prototype = {
|
||||
cookies : null,
|
||||
history : null,
|
||||
prefs : null,
|
||||
userData : null,
|
||||
},
|
||||
|
||||
_homepageURL : null,
|
||||
_replaceBookmarks : false,
|
||||
_sourceProfile: null,
|
||||
_profilesCache: null,
|
||||
|
||||
/*
|
||||
/**
|
||||
* Notify to observers to start migration
|
||||
*
|
||||
* @param aType
|
||||
* notification type such as MIGRATE_BOOKMARKS
|
||||
*/
|
||||
|
||||
_notifyStart : function Chrome_notifyStart(aType)
|
||||
{
|
||||
Services.obs.notifyObservers(null, "Migration:ItemBeforeMigrate", aType);
|
||||
this._pendingCount++;
|
||||
},
|
||||
|
||||
/*
|
||||
/**
|
||||
* Notify observers that a migration error occured with an item
|
||||
*
|
||||
* @param aType
|
||||
* notification type such as MIGRATE_BOOKMARKS
|
||||
*/
|
||||
_notifyError : function Chrome_notifyError(aType)
|
||||
{
|
||||
Services.obs.notifyObservers(null, "Migration:ItemError", aType);
|
||||
},
|
||||
|
||||
/**
|
||||
* Notify to observers to finish migration for item
|
||||
* If all items are finished, it sends migration end notification.
|
||||
*
|
||||
@ -163,7 +177,7 @@ ChromeProfileMigrator.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
/*
|
||||
/**
|
||||
* Migrating bookmark items
|
||||
*/
|
||||
_migrateBookmarks : function Chrome_migrateBookmarks()
|
||||
@ -224,11 +238,12 @@ ChromeProfileMigrator.prototype = {
|
||||
}, null);
|
||||
} catch (e) {
|
||||
Cu.reportError(e);
|
||||
this._notifyError(MIGRATE_BOOKMARKS);
|
||||
this._notifyCompleted(MIGRATE_BOOKMARKS);
|
||||
}
|
||||
},
|
||||
|
||||
/*
|
||||
/**
|
||||
* Migrating history
|
||||
*/
|
||||
_migrateHistory : function Chrome_migrateHistory()
|
||||
@ -298,11 +313,12 @@ ChromeProfileMigrator.prototype = {
|
||||
}, null);
|
||||
} catch (e) {
|
||||
Cu.reportError(e);
|
||||
this._notifyError(MIGRATE_HISTORY);
|
||||
this._notifyCompleted(MIGRATE_HISTORY);
|
||||
}
|
||||
},
|
||||
|
||||
/*
|
||||
/**
|
||||
* Migrating cookies
|
||||
*/
|
||||
_migrateCookies : function Chrome_migrateCookies()
|
||||
@ -359,23 +375,24 @@ ChromeProfileMigrator.prototype = {
|
||||
stmt.finalize();
|
||||
} catch (e) {
|
||||
Cu.reportError(e);
|
||||
this._notifyError(MIGRATE_COOKIES);
|
||||
this._notifyCompleted(MIGRATE_COOKIES);
|
||||
}
|
||||
},
|
||||
|
||||
/*
|
||||
/**
|
||||
* nsIBrowserProfileMigrator interface implementation
|
||||
*/
|
||||
|
||||
/*
|
||||
/**
|
||||
* Let's migrate all items
|
||||
*
|
||||
* @param aItems
|
||||
* list of data items to migrate. but this is unused.
|
||||
* list of data items to migrate.
|
||||
* @param aStartup
|
||||
* non-null if called during startup.
|
||||
* @param aProfile
|
||||
* this is unused due to single profile support only
|
||||
* profile directory name to migrate
|
||||
*/
|
||||
migrate : function Chrome_migrate(aItems, aStartup, aProfile)
|
||||
{
|
||||
@ -384,6 +401,8 @@ ChromeProfileMigrator.prototype = {
|
||||
this._replaceBookmarks = true;
|
||||
}
|
||||
|
||||
this._sourceProfile = aProfile;
|
||||
|
||||
Services.obs.notifyObservers(null, "Migration:Started", null);
|
||||
|
||||
// Reset panding count. If this count becomes 0, "Migration:Ended"
|
||||
@ -407,53 +426,51 @@ ChromeProfileMigrator.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
/*
|
||||
/**
|
||||
* return supported migration types
|
||||
*
|
||||
* @param aProfile
|
||||
* this is unused due to single profile support only
|
||||
* directory name of the profile
|
||||
* @param aDoingStartup
|
||||
* non-null if called during startup.
|
||||
* @return supported migration types
|
||||
*/
|
||||
getMigrateData: function Chrome_getMigrateData(aProfile, aDoingStartup)
|
||||
{
|
||||
#ifdef XP_WIN
|
||||
let chromepath = Services.dirsvc.get("LocalAppData", Ci.nsIFile).path +
|
||||
"\\Google\\Chrome\\User Data\\Default\\";
|
||||
#elifdef XP_MACOSX
|
||||
let chromepath = Services.dirsvc.get("Home", Ci.nsIFile).path +
|
||||
"/Library/Application Support/Google/Chrome/Default/";
|
||||
#else
|
||||
let chromepath = Services.dirsvc.get("Home", Ci.nsIFile).path +
|
||||
"/.config/google-chrome/Default/";
|
||||
#endif
|
||||
this._sourceProfile = aProfile;
|
||||
let chromeProfileDir = Cc[LOCAL_FILE_CID].createInstance(Ci.nsILocalFile);
|
||||
chromeProfileDir.initWithPath(this._paths.userData + aProfile);
|
||||
|
||||
let result = 0;
|
||||
if (!chromeProfileDir.exists() || !chromeProfileDir.isReadable())
|
||||
return result;
|
||||
|
||||
// bookmark and preference are JSON format
|
||||
|
||||
try {
|
||||
let file = Cc[LOCAL_FILE_CID].createInstance(Ci.nsILocalFile);
|
||||
file.initWithPath(chromepath + "Bookmarks");
|
||||
let file = chromeProfileDir.clone();
|
||||
file.append("Bookmarks");
|
||||
if (file.exists()) {
|
||||
this._paths.bookmarks = file.path
|
||||
this._paths.bookmarks = file.path;
|
||||
result += MIGRATE_BOOKMARKS;
|
||||
}
|
||||
} catch (e) {
|
||||
Cu.reportError(e);
|
||||
}
|
||||
|
||||
if (!this._paths.prefs)
|
||||
this._paths.prefs = chromepath + "Preferences";
|
||||
if (!this._paths.prefs) {
|
||||
let file = chromeProfileDir.clone();
|
||||
file.append("Preferences");
|
||||
this._paths.prefs = file.path;
|
||||
}
|
||||
|
||||
// history and cookies are SQLite database
|
||||
|
||||
try {
|
||||
let file = Cc[LOCAL_FILE_CID].createInstance(Ci.nsILocalFile);
|
||||
file.initWithPath(chromepath + "History");
|
||||
let file = chromeProfileDir.clone();
|
||||
file.append("History");
|
||||
if (file.exists()) {
|
||||
this._paths.history = file.path
|
||||
this._paths.history = file.path;
|
||||
result += MIGRATE_HISTORY;
|
||||
}
|
||||
} catch (e) {
|
||||
@ -461,10 +478,10 @@ ChromeProfileMigrator.prototype = {
|
||||
}
|
||||
|
||||
try {
|
||||
let file = Cc[LOCAL_FILE_CID].createInstance(Ci.nsILocalFile);
|
||||
file.initWithPath(chromepath + "Cookies");
|
||||
let file = chromeProfileDir.clone();
|
||||
file.append("Cookies");
|
||||
if (file.exists()) {
|
||||
this._paths.cookies = file.path
|
||||
this._paths.cookies = file.path;
|
||||
result += MIGRATE_COOKIES;
|
||||
}
|
||||
} catch (e) {
|
||||
@ -474,23 +491,87 @@ ChromeProfileMigrator.prototype = {
|
||||
return result;
|
||||
},
|
||||
|
||||
/*
|
||||
/**
|
||||
* Whether we support migration of Chrome
|
||||
*
|
||||
* @return true if supported
|
||||
*/
|
||||
get sourceExists()
|
||||
{
|
||||
let result = this.getMigrateData(null, false);
|
||||
return result != 0;
|
||||
#ifdef XP_WIN
|
||||
this._paths.userData = Services.dirsvc.get("LocalAppData", Ci.nsIFile).path +
|
||||
"\\Google\\Chrome\\User Data\\";
|
||||
#elifdef XP_MACOSX
|
||||
this._paths.userData = Services.dirsvc.get("Home", Ci.nsIFile).path +
|
||||
"/Library/Application Support/Google/Chrome/";
|
||||
#else
|
||||
this._paths.userData = Services.dirsvc.get("Home", Ci.nsIFile).path +
|
||||
"/.config/google-chrome/";
|
||||
#endif
|
||||
let result = 0;
|
||||
try {
|
||||
let userDataDir = Cc[LOCAL_FILE_CID].createInstance(Ci.nsILocalFile);
|
||||
userDataDir.initWithPath(this._paths.userData);
|
||||
if (!userDataDir.exists() || !userDataDir.isReadable())
|
||||
return false;
|
||||
|
||||
let profiles = this.sourceProfiles;
|
||||
if (profiles.length < 1)
|
||||
return false;
|
||||
|
||||
// check that we can actually get data from the first profile
|
||||
result = this.getMigrateData(profiles.queryElementAt(0, Ci.nsISupportsString), false);
|
||||
} catch (e) {
|
||||
Cu.reportError(e);
|
||||
}
|
||||
return result > 0;
|
||||
},
|
||||
|
||||
// Although Chrome supports multi-profiles, there is no way
|
||||
// to get profile lists.
|
||||
sourceHasMultipleProfiles: false,
|
||||
sourceProfiles: null,
|
||||
get sourceHasMultipleProfiles()
|
||||
{
|
||||
return this.sourceProfiles.length > 1;
|
||||
},
|
||||
|
||||
/*
|
||||
get sourceProfiles()
|
||||
{
|
||||
let profiles = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray);
|
||||
try {
|
||||
if (!this._profilesCache) {
|
||||
let localState = Cc[LOCAL_FILE_CID].createInstance(Ci.nsILocalFile);
|
||||
// Local State is a JSON file that contains profile info.
|
||||
localState.initWithPath(this._paths.userData + "Local State");
|
||||
if (!localState.exists())
|
||||
throw new Components.Exception("Chrome's 'Local State' file does not exist.",
|
||||
Cr.NS_ERROR_FILE_NOT_FOUND);
|
||||
if (!localState.isReadable())
|
||||
throw new Components.Exception("Chrome's 'Local State' file could not be read.",
|
||||
Cr.NS_ERROR_FILE_ACCESS_DENIED);
|
||||
let fstream = Cc[FILE_INPUT_STREAM_CID].createInstance(Ci.nsIFileInputStream);
|
||||
fstream.init(localState, -1, 0, 0);
|
||||
let inputStream = NetUtil.readInputStreamToString(fstream, fstream.available(),
|
||||
{ charset: "UTF-8" });
|
||||
this._profilesCache = JSON.parse(inputStream).profile.info_cache;
|
||||
}
|
||||
|
||||
for (let index in this._profilesCache) {
|
||||
let str = Cc["@mozilla.org/supports-string;1"].createInstance(Ci.nsISupportsString);
|
||||
str.data = index;
|
||||
profiles.appendElement(str, false);
|
||||
}
|
||||
} catch (e) {
|
||||
Cu.reportError("Error detecting Chrome profiles: " + e);
|
||||
// if we weren't able to detect any profiles above, fallback to the Default profile.
|
||||
if (profiles.length < 1) {
|
||||
let str = Cc["@mozilla.org/supports-string;1"].createInstance(Ci.nsISupportsString);
|
||||
// the default profile name is "Default"
|
||||
str.data = "Default";
|
||||
profiles.appendElement(str, false);
|
||||
}
|
||||
}
|
||||
return profiles;
|
||||
},
|
||||
|
||||
/**
|
||||
* Return home page URL
|
||||
*
|
||||
* @return home page URL
|
||||
@ -502,7 +583,7 @@ ChromeProfileMigrator.prototype = {
|
||||
return this._homepageURL;
|
||||
|
||||
if (!this._paths.prefs)
|
||||
this.getMigrateData(null, false);
|
||||
this.getMigrateData(this._sourceProfile, false);
|
||||
|
||||
// XXX reading and parsing JSON is synchronous.
|
||||
let file = Cc[LOCAL_FILE_CID].createInstance(Ci.nsILocalFile);
|
||||
|
@ -54,7 +54,6 @@
|
||||
#include "nsAppDirectoryServiceDefs.h"
|
||||
#include "nsIRDFService.h"
|
||||
#include "nsIStringBundle.h"
|
||||
#include "nsISupportsArray.h"
|
||||
#include "nsXPCOMCID.h"
|
||||
|
||||
#define MIGRATION_BUNDLE "chrome://browser/locale/migration/migration.properties"
|
||||
|
@ -65,7 +65,6 @@
|
||||
#include "nsIPrefService.h"
|
||||
#include "nsIPrefBranch.h"
|
||||
#include "nsISimpleEnumerator.h"
|
||||
#include "nsISupportsArray.h"
|
||||
#include "nsIProfileMigrator.h"
|
||||
#include "nsIBrowserProfileMigrator.h"
|
||||
#include "nsIObserverService.h"
|
||||
@ -486,7 +485,7 @@ nsIEProfileMigrator::GetSourceHasMultipleProfiles(bool* aResult)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsIEProfileMigrator::GetSourceProfiles(nsISupportsArray** aResult)
|
||||
nsIEProfileMigrator::GetSourceProfiles(nsIArray** aResult)
|
||||
{
|
||||
*aResult = nsnull;
|
||||
return NS_OK;
|
||||
|
@ -170,12 +170,12 @@ nsOperaProfileMigrator::GetMigrateData(const PRUnichar* aProfile,
|
||||
NS_IMETHODIMP
|
||||
nsOperaProfileMigrator::GetSourceExists(bool* aResult)
|
||||
{
|
||||
nsCOMPtr<nsISupportsArray> profiles;
|
||||
nsCOMPtr<nsIArray> profiles;
|
||||
GetSourceProfiles(getter_AddRefs(profiles));
|
||||
|
||||
if (profiles) {
|
||||
PRUint32 count;
|
||||
profiles->Count(&count);
|
||||
profiles->GetLength(&count);
|
||||
*aResult = count > 0;
|
||||
}
|
||||
else
|
||||
@ -187,13 +187,13 @@ nsOperaProfileMigrator::GetSourceExists(bool* aResult)
|
||||
NS_IMETHODIMP
|
||||
nsOperaProfileMigrator::GetSourceHasMultipleProfiles(bool* aResult)
|
||||
{
|
||||
nsCOMPtr<nsISupportsArray> profiles;
|
||||
nsCOMPtr<nsIArray> profiles;
|
||||
GetSourceProfiles(getter_AddRefs(profiles));
|
||||
|
||||
#ifdef XP_WIN
|
||||
if (profiles) {
|
||||
PRUint32 count;
|
||||
profiles->Count(&count);
|
||||
profiles->GetLength(&count);
|
||||
*aResult = count > 1;
|
||||
}
|
||||
else
|
||||
@ -204,12 +204,12 @@ nsOperaProfileMigrator::GetSourceHasMultipleProfiles(bool* aResult)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsOperaProfileMigrator::GetSourceProfiles(nsISupportsArray** aResult)
|
||||
nsOperaProfileMigrator::GetSourceProfiles(nsIArray** aResult)
|
||||
{
|
||||
if (!mProfiles) {
|
||||
nsresult rv;
|
||||
|
||||
mProfiles = do_CreateInstance(NS_SUPPORTSARRAY_CONTRACTID, &rv);
|
||||
mProfiles = do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsCOMPtr<nsIProperties> fileLocator(do_GetService("@mozilla.org/file/directory_service;1"));
|
||||
@ -238,7 +238,7 @@ nsOperaProfileMigrator::GetSourceProfiles(nsISupportsArray** aResult)
|
||||
nsAutoString leafName;
|
||||
curr->GetLeafName(leafName);
|
||||
string->SetData(leafName);
|
||||
mProfiles->AppendElement(string);
|
||||
mProfiles->AppendElement(string, false);
|
||||
}
|
||||
|
||||
e->HasMoreElements(&hasMore);
|
||||
@ -255,7 +255,7 @@ nsOperaProfileMigrator::GetSourceProfiles(nsISupportsArray** aResult)
|
||||
if (exists) {
|
||||
nsCOMPtr<nsISupportsString> string(do_CreateInstance("@mozilla.org/supports-string;1"));
|
||||
string->SetData(OPERA_PREFERENCES_FOLDER_NAME);
|
||||
mProfiles->AppendElement(string);
|
||||
mProfiles->AppendElement(string, false);
|
||||
}
|
||||
#elif defined (XP_UNIX)
|
||||
fileLocator->Get(NS_UNIX_HOME_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(file));
|
||||
@ -268,7 +268,7 @@ nsOperaProfileMigrator::GetSourceProfiles(nsISupportsArray** aResult)
|
||||
if (exists) {
|
||||
nsCOMPtr<nsISupportsString> string(do_CreateInstance("@mozilla.org/supports-string;1"));
|
||||
string->SetData(OPERA_PREFERENCES_FOLDER_NAME);
|
||||
mProfiles->AppendElement(string);
|
||||
mProfiles->AppendElement(string, false);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -42,9 +42,9 @@
|
||||
#include "nsIBinaryInputStream.h"
|
||||
#include "nsIBrowserProfileMigrator.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsISupportsArray.h"
|
||||
#include "nsStringAPI.h"
|
||||
#include "nsTArray.h"
|
||||
#include "nsIMutableArray.h"
|
||||
#include "nsINavHistoryService.h"
|
||||
#include "nsIStringBundle.h"
|
||||
|
||||
@ -144,7 +144,7 @@ protected:
|
||||
|
||||
private:
|
||||
nsCOMPtr<nsILocalFile> mOperaProfile;
|
||||
nsCOMPtr<nsISupportsArray> mProfiles;
|
||||
nsCOMPtr<nsIMutableArray> mProfiles;
|
||||
nsCOMPtr<nsIObserverService> mObserverService;
|
||||
};
|
||||
|
||||
|
@ -45,7 +45,7 @@
|
||||
#include "nsIProperties.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsISupportsPrimitives.h"
|
||||
#include "nsISupportsArray.h"
|
||||
#include "nsIMutableArray.h"
|
||||
#include "nsIToolkitProfile.h"
|
||||
#include "nsIToolkitProfileService.h"
|
||||
#include "nsIWindowWatcher.h"
|
||||
@ -127,13 +127,12 @@ nsProfileMigrator::Migrate(nsIProfileStartup* aStartup)
|
||||
// By opening the Migration FE with a supplied bpm, it will automatically
|
||||
// migrate from it.
|
||||
nsCOMPtr<nsIWindowWatcher> ww(do_GetService(NS_WINDOWWATCHER_CONTRACTID));
|
||||
nsCOMPtr<nsISupportsArray> params =
|
||||
do_CreateInstance(NS_SUPPORTSARRAY_CONTRACTID);
|
||||
nsCOMPtr<nsIMutableArray> params = do_CreateInstance(NS_ARRAY_CONTRACTID);
|
||||
if (!ww || !params) return NS_ERROR_FAILURE;
|
||||
|
||||
params->AppendElement(cstr);
|
||||
params->AppendElement(bpm);
|
||||
params->AppendElement(aStartup);
|
||||
params->AppendElement(cstr, false);
|
||||
params->AppendElement(bpm, false);
|
||||
params->AppendElement(aStartup, false);
|
||||
|
||||
nsCOMPtr<nsIDOMWindow> migrateWizard;
|
||||
return ww->OpenWindow(nsnull,
|
||||
|
@ -59,7 +59,6 @@
|
||||
#include "nsIRDFService.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIStringBundle.h"
|
||||
#include "nsISupportsArray.h"
|
||||
#include "nsISupportsPrimitives.h"
|
||||
#include "nsSafariProfileMigrator.h"
|
||||
#include "nsToolkitCompsCID.h"
|
||||
@ -202,7 +201,7 @@ nsSafariProfileMigrator::GetSourceHasMultipleProfiles(bool* aResult)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSafariProfileMigrator::GetSourceProfiles(nsISupportsArray** aResult)
|
||||
nsSafariProfileMigrator::GetSourceProfiles(nsIArray** aResult)
|
||||
{
|
||||
*aResult = nsnull;
|
||||
return NS_OK;
|
||||
|
@ -41,7 +41,6 @@
|
||||
|
||||
#include "nsIBrowserProfileMigrator.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsISupportsArray.h"
|
||||
#include "nsStringAPI.h"
|
||||
#include "nsINavHistoryService.h"
|
||||
|
||||
|
@ -99,4 +99,5 @@ function test() {
|
||||
});
|
||||
|
||||
waitForExplicitFinish();
|
||||
ignoreAllUncaughtExceptions();
|
||||
}
|
||||
|
@ -45,6 +45,7 @@ function test() {
|
||||
let cm = Cc["@mozilla.org/cookiemanager;1"].
|
||||
getService(Ci.nsICookieManager);
|
||||
waitForExplicitFinish();
|
||||
ignoreAllUncaughtExceptions();
|
||||
|
||||
const TEST_URL = "http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/title.sjs";
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
ignoreAllUncaughtExceptions();
|
||||
|
||||
let blankState = { windows: [{ tabs: [{ entries: [{ url: "about:blank" }] }]}]};
|
||||
let crashState = { windows: [{ tabs: [{ entries: [{ url: "about:mozilla" }] }]}]};
|
||||
|
@ -44,6 +44,7 @@ function observeOneRestore(callback) {
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
ignoreAllUncaughtExceptions();
|
||||
|
||||
// There should be one tab when we start the test
|
||||
let [origTab] = gBrowser.visibleTabs;
|
||||
|
@ -52,6 +52,7 @@ function cleanup() {
|
||||
function test() {
|
||||
/** Bug 607016 - If a tab is never restored, attributes (eg. hidden) aren't updated correctly **/
|
||||
waitForExplicitFinish();
|
||||
ignoreAllUncaughtExceptions();
|
||||
|
||||
// Set the pref to true so we know exactly how many tabs should be restoring at
|
||||
// any given time. This guarantees that a finishing load won't start another.
|
||||
|
@ -148,6 +148,7 @@ function GroupItem(listOfEls, options) {
|
||||
.click(function() {
|
||||
self.closeAll();
|
||||
})
|
||||
.attr("title", tabviewString("groupItem.closeGroup"))
|
||||
.appendTo($container);
|
||||
|
||||
// ___ Title
|
||||
@ -198,7 +199,8 @@ function GroupItem(listOfEls, options) {
|
||||
e.stopPropagation();
|
||||
})
|
||||
.keypress(handleKeyPress)
|
||||
.keyup(handleKeyUp);
|
||||
.keyup(handleKeyUp)
|
||||
.attr("title", tabviewString("groupItem.defaultName"));
|
||||
|
||||
this.$titleShield
|
||||
.mousedown(function(e) {
|
||||
@ -212,7 +214,8 @@ function GroupItem(listOfEls, options) {
|
||||
|
||||
if (!self.isDragging)
|
||||
self.focusTitle();
|
||||
});
|
||||
})
|
||||
.attr("title", tabviewString("groupItem.defaultName"));
|
||||
|
||||
if (options.focusTitle)
|
||||
this.focusTitle();
|
||||
@ -904,6 +907,7 @@ GroupItem.prototype = Utils.extend(new Item(), new Subscribable(), {
|
||||
.appendTo(this.$undoContainer);
|
||||
let undoClose = iQ("<span/>")
|
||||
.addClass("close")
|
||||
.attr("title", tabviewString("groupItem.discardClosedGroup"))
|
||||
.appendTo(this.$undoContainer);
|
||||
|
||||
this.$undoContainer.css({
|
||||
@ -1143,7 +1147,7 @@ GroupItem.prototype = Utils.extend(new Item(), new Subscribable(), {
|
||||
|
||||
let closed = options.dontClose ? false : this.closeIfEmpty();
|
||||
if (closed ||
|
||||
(this._children.length == 0 && !gBrowser.selectedTab.pinned &&
|
||||
(this._children.length == 0 && !gBrowser._numPinnedTabs &&
|
||||
!item.isDragging)) {
|
||||
this._makeLastActiveGroupItemActive();
|
||||
} else if (!options.dontArrange) {
|
||||
@ -2230,29 +2234,31 @@ let GroupItems = {
|
||||
}
|
||||
|
||||
toClose.forEach(function(groupItem) {
|
||||
// All remaining children in to-be-closed groups are re-used by
|
||||
// session restore. Reconnect them so that they're put into their
|
||||
// right groups.
|
||||
let children = groupItem.getChildren().concat();
|
||||
|
||||
children.forEach(function (tabItem) {
|
||||
if (tabItem.parent && tabItem.parent.hidden)
|
||||
// all tabs still existing in closed groups will be moved to new
|
||||
// groups. prepare them to be reconnected later.
|
||||
groupItem.getChildren().forEach(function (tabItem) {
|
||||
if (tabItem.parent.hidden)
|
||||
iQ(tabItem.container).show();
|
||||
|
||||
tabItem._reconnected = false;
|
||||
|
||||
// sanity check the tab's groupID
|
||||
let tabData = Storage.getTabData(tabItem.tab);
|
||||
let parentGroup = GroupItems.groupItem(tabData.groupID);
|
||||
|
||||
// correct the tab's groupID if necessary
|
||||
if (!parentGroup || -1 < toClose.indexOf(parentGroup)) {
|
||||
tabData.groupID = activeGroupId || Object.keys(groupItemData)[0];
|
||||
Storage.saveTab(tabItem.tab, tabData);
|
||||
if (tabData) {
|
||||
let parentGroup = GroupItems.groupItem(tabData.groupID);
|
||||
|
||||
// the tab's group id could be invalid or point to a non-existing
|
||||
// group. correct it by assigning the active group id or the first
|
||||
// group of the just restored session.
|
||||
if (!parentGroup || -1 < toClose.indexOf(parentGroup)) {
|
||||
tabData.groupID = activeGroupId || Object.keys(groupItemData)[0];
|
||||
Storage.saveTab(tabItem.tab, tabData);
|
||||
}
|
||||
}
|
||||
|
||||
tabItem._reconnected = false;
|
||||
tabItem._reconnect();
|
||||
});
|
||||
|
||||
// this closes the group but not its children
|
||||
groupItem.close({immediately: true});
|
||||
});
|
||||
}
|
||||
@ -2466,10 +2472,14 @@ let GroupItems = {
|
||||
// ----------
|
||||
// Function: updateActiveGroupItemAndTabBar
|
||||
// Sets active TabItem and GroupItem, and updates tab bar appropriately.
|
||||
updateActiveGroupItemAndTabBar: function GroupItems_updateActiveGroupItemAndTabBar(tabItem) {
|
||||
// Parameters:
|
||||
// tabItem - the tab item
|
||||
// options - is passed to UI.setActive() directly
|
||||
updateActiveGroupItemAndTabBar:
|
||||
function GroupItems_updateActiveGroupItemAndTabBar(tabItem, options) {
|
||||
Utils.assertThrow(tabItem && tabItem.isATabItem, "tabItem must be a TabItem");
|
||||
|
||||
UI.setActive(tabItem);
|
||||
UI.setActive(tabItem, options);
|
||||
this._updateTabBar();
|
||||
},
|
||||
|
||||
|
@ -431,13 +431,15 @@ let Search = {
|
||||
|
||||
iQ("#searchbox").keyup(function Search_init_box_keyup() {
|
||||
self.perform();
|
||||
});
|
||||
})
|
||||
.attr("title", tabviewString("button.searchTabs"));
|
||||
|
||||
iQ("#searchbutton").mousedown(function Search_init_button_mousedown() {
|
||||
self._initiatedBy = "buttonclick";
|
||||
self.ensureShown();
|
||||
self.switchToInMode();
|
||||
});
|
||||
})
|
||||
.attr("title", tabviewString("button.searchTabs"));
|
||||
|
||||
window.addEventListener("focus", function Search_init_window_focus() {
|
||||
if (self.isEnabled()) {
|
||||
|
@ -148,6 +148,8 @@ function TabItem(tab, options) {
|
||||
|
||||
this.droppable(true);
|
||||
|
||||
this.$close.attr("title", tabbrowserString("tabs.closeTab"));
|
||||
|
||||
TabItems.register(this);
|
||||
|
||||
// ___ reconnect to data from Storage
|
||||
@ -204,7 +206,15 @@ TabItem.prototype = Utils.extend(new Item(), new Subscribable(), {
|
||||
this._cachedImageData = imageData;
|
||||
this.$cachedThumb.attr("src", this._cachedImageData).show();
|
||||
this.$canvas.css({opacity: 0});
|
||||
this.$tabTitle.text(tabData.title ? tabData.title : "");
|
||||
let label = "";
|
||||
let title;
|
||||
if (tabData.title) {
|
||||
label = tabData.title;
|
||||
title = label + "\n" + tabData.url;
|
||||
} else {
|
||||
title = tabData.url;
|
||||
}
|
||||
this.$tabTitle.text(label).attr("title", title);
|
||||
|
||||
this._sendToSubscribers("showingCachedData");
|
||||
},
|
||||
@ -1003,10 +1013,10 @@ let TabItems = {
|
||||
// ___ URL
|
||||
let tabUrl = tab.linkedBrowser.currentURI.spec;
|
||||
if (tabUrl != tabItem.url) {
|
||||
let oldURL = tabItem.url;
|
||||
tabItem.url = tabUrl;
|
||||
tabItem.save();
|
||||
}
|
||||
tabItem.$container.attr("title", label + "\n" + tabUrl);
|
||||
|
||||
// ___ Make sure the tab is complete and ready for updating.
|
||||
if (!this.isComplete(tab) && (!options || !options.force)) {
|
||||
|
@ -13,8 +13,13 @@ XPCOMUtils.defineLazyGetter(this, "tabviewBundle", function() {
|
||||
return Services.strings.
|
||||
createBundle("chrome://browser/locale/tabview.properties");
|
||||
});
|
||||
XPCOMUtils.defineLazyGetter(this, "tabbrowserBundle", function() {
|
||||
return Services.strings.
|
||||
createBundle("chrome://browser/locale/tabbrowser.properties");
|
||||
});
|
||||
|
||||
function tabviewString(name) tabviewBundle.GetStringFromName('tabview.' + name);
|
||||
function tabbrowserString(name) tabbrowserBundle.GetStringFromName(name);
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "gPrefBranch", function() {
|
||||
return Services.prefs.getBranch("browser.panorama.");
|
||||
|
@ -87,8 +87,9 @@ _BROWSER_FILES = \
|
||||
browser_tabview_bug606905.js \
|
||||
browser_tabview_bug607108.js \
|
||||
browser_tabview_bug608037.js \
|
||||
browser_tabview_bug608184.js \
|
||||
browser_tabview_bug608153.js \
|
||||
browser_tabview_bug608158.js \
|
||||
browser_tabview_bug608184.js \
|
||||
browser_tabview_bug608405.js \
|
||||
browser_tabview_bug610208.js \
|
||||
browser_tabview_bug610242.js \
|
||||
@ -165,6 +166,8 @@ _BROWSER_FILES = \
|
||||
browser_tabview_bug686654.js \
|
||||
browser_tabview_bug697390.js \
|
||||
browser_tabview_bug705621.js \
|
||||
browser_tabview_bug706430.js \
|
||||
browser_tabview_bug706736.js \
|
||||
browser_tabview_click_group.js \
|
||||
browser_tabview_dragdrop.js \
|
||||
browser_tabview_exit_button.js \
|
||||
|
48
browser/components/tabview/test/browser_tabview_bug608153.js
Normal file
48
browser/components/tabview/test/browser_tabview_bug608153.js
Normal file
@ -0,0 +1,48 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
let pinnedTab = gBrowser.addTab();
|
||||
gBrowser.pinTab(pinnedTab);
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
gBrowser.unpinTab(pinnedTab);
|
||||
while (gBrowser.tabs[1])
|
||||
gBrowser.removeTab(gBrowser.tabs[1]);
|
||||
hideTabView();
|
||||
});
|
||||
|
||||
showTabView(function() {
|
||||
let cw = TabView.getContentWindow();
|
||||
let groupItemOne = cw.GroupItems.groupItems[0];
|
||||
let groupItemTwo = createGroupItemWithBlankTabs(window, 250, 250, 40, 1);
|
||||
|
||||
is(cw.GroupItems.groupItems.length, 2, "Two group items");
|
||||
|
||||
hideTabView(function() {
|
||||
gBrowser.selectedTab = pinnedTab;
|
||||
is(cw.GroupItems.getActiveGroupItem(), groupItemTwo, "Group two is active");
|
||||
is(gBrowser.selectedTab, pinnedTab, "Selected tab is the pinned tab");
|
||||
|
||||
goToNextGroup();
|
||||
is(cw.GroupItems.getActiveGroupItem(), groupItemOne, "Group one is active");
|
||||
is(gBrowser.selectedTab, pinnedTab, "Selected tab is the pinned tab");
|
||||
|
||||
finish();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function goToNextGroup() {
|
||||
let utils =
|
||||
QueryInterface(Ci.nsIInterfaceRequestor).
|
||||
getInterface(Ci.nsIDOMWindowUtils);
|
||||
|
||||
const masks = Ci.nsIDOMNSEvent;
|
||||
let mval = 0;
|
||||
mval |= masks.CONTROL_MASK;
|
||||
|
||||
utils.sendKeyEvent("keypress", 0, 96, mval);
|
||||
}
|
@ -15,7 +15,7 @@ function test() {
|
||||
is(groupItemOne.getChildren().length, 1, "Group one has 1 tab item");
|
||||
|
||||
let groupItemTwo = createGroupItemWithBlankTabs(win, 300, 300, 40, 1);
|
||||
is(groupItemTwo.getChildren().length, 1, "Group two has 2 tab items");
|
||||
is(groupItemTwo.getChildren().length, 1, "Group two has 1 tab item");
|
||||
|
||||
whenTabViewIsHidden(function() {
|
||||
executeSoon(function() {
|
||||
|
65
browser/components/tabview/test/browser_tabview_bug706430.js
Normal file
65
browser/components/tabview/test/browser_tabview_bug706430.js
Normal file
@ -0,0 +1,65 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
let state1 = {
|
||||
windows: [{
|
||||
tabs: [{
|
||||
entries: [{ url: "about:blank#1" }],
|
||||
hidden: true,
|
||||
extData: {"tabview-tab": '{"url":"about:blank#1","groupID":1,"bounds":{"left":120,"top":20,"width":20,"height":20}}'}
|
||||
},{
|
||||
entries: [{ url: "about:blank#2" }],
|
||||
hidden: false,
|
||||
extData: {"tabview-tab": '{"url":"about:blank#2","groupID":2,"bounds":{"left":20,"top":20,"width":20,"height":20}}'},
|
||||
}],
|
||||
selected: 2,
|
||||
extData: {
|
||||
"tabview-groups": '{"nextID":3,"activeGroupId":2, "totalNumber":2}',
|
||||
"tabview-group":
|
||||
'{"1":{"bounds":{"left":15,"top":5,"width":280,"height":232},"id":1},' +
|
||||
'"2":{"bounds":{"left":309,"top":5,"width":267,"height":226},"id":2}}'
|
||||
}
|
||||
}]
|
||||
};
|
||||
|
||||
let state2 = {
|
||||
windows: [{
|
||||
tabs: [{entries: [{ url: "about:blank#1" }], hidden: true},
|
||||
{entries: [{ url: "about:blank#2" }], hidden: false}],
|
||||
selected: 2
|
||||
}]
|
||||
};
|
||||
|
||||
let ss = Cc["@mozilla.org/browser/sessionstore;1"]
|
||||
.getService(Ci.nsISessionStore);
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
newWindowWithState(state1, function (win) {
|
||||
registerCleanupFunction(function () win.close());
|
||||
|
||||
showTabView(function () {
|
||||
let cw = win.TabView.getContentWindow();
|
||||
let [group1, group2] = cw.GroupItems.groupItems;
|
||||
let [tab1, tab2] = win.gBrowser.tabs;
|
||||
|
||||
checkUrl(group1.getChild(0), "about:blank#1", "tab1 is in first group");
|
||||
checkUrl(group2.getChild(0), "about:blank#2", "tab2 is in second group");
|
||||
|
||||
whenWindowStateReady(win, function () {
|
||||
let groups = cw.GroupItems.groupItems;
|
||||
is(groups.length, 1, "one groupItem");
|
||||
is(groups[0].getChildren().length, 2, "single groupItem has two children");
|
||||
|
||||
finish();
|
||||
});
|
||||
|
||||
ss.setWindowState(win, JSON.stringify(state2), true);
|
||||
}, win);
|
||||
});
|
||||
}
|
||||
|
||||
function checkUrl(aTabItem, aUrl, aMsg) {
|
||||
is(aTabItem.tab.linkedBrowser.currentURI.spec, aUrl, aMsg);
|
||||
}
|
40
browser/components/tabview/test/browser_tabview_bug706736.js
Normal file
40
browser/components/tabview/test/browser_tabview_bug706736.js
Normal file
@ -0,0 +1,40 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
newWindowWithTabView(function(win) {
|
||||
registerCleanupFunction(function() {
|
||||
win.close();
|
||||
});
|
||||
|
||||
let cw = win.TabView.getContentWindow();
|
||||
|
||||
let groupItemOne = cw.GroupItems.groupItems[0];
|
||||
is(groupItemOne.getChildren().length, 1, "Group one has 1 tab item");
|
||||
|
||||
let groupItemTwo = createGroupItemWithBlankTabs(win, 300, 300, 40, 1);
|
||||
is(groupItemTwo.getChildren().length, 1, "Group two has 1 tab items");
|
||||
|
||||
whenTabViewIsHidden(function() {
|
||||
win.gBrowser.removeTab(win.gBrowser.selectedTab);
|
||||
executeSoon(function() {
|
||||
win.undoCloseTab();
|
||||
|
||||
groupItemTwo.addSubscriber("childAdded", function onChildAdded(data) {
|
||||
groupItemTwo.removeSubscriber("childAdded", onChildAdded);
|
||||
|
||||
is(groupItemOne.getChildren().length, 1, "Group one still has 1 tab item");
|
||||
is(groupItemTwo.getChildren().length, 1, "Group two still has 1 tab item");
|
||||
});
|
||||
|
||||
finish();
|
||||
});
|
||||
}, win);
|
||||
groupItemTwo.getChild(0).zoomIn();
|
||||
}, function(win) {
|
||||
let newTab = win.gBrowser.addTab();
|
||||
win.gBrowser.pinTab(newTab);
|
||||
});
|
||||
}
|
@ -195,7 +195,8 @@ let UI = {
|
||||
iQ("#exit-button").click(function() {
|
||||
self.exit();
|
||||
self.blurAll();
|
||||
});
|
||||
})
|
||||
.attr("title", tabviewString("button.exitTabGroups"));
|
||||
|
||||
// When you click on the background/empty part of TabView,
|
||||
// we create a new groupItem.
|
||||
@ -465,7 +466,8 @@ let UI = {
|
||||
if (item.isATabItem) {
|
||||
if (item.parent)
|
||||
GroupItems.setActiveGroupItem(item.parent);
|
||||
this._setActiveTab(item);
|
||||
if (!options || !options.dontSetActiveTabInGroup)
|
||||
this._setActiveTab(item);
|
||||
} else {
|
||||
GroupItems.setActiveGroupItem(item);
|
||||
if (!options || !options.dontSetActiveTabInGroup) {
|
||||
|
@ -2220,7 +2220,9 @@ InspectorProgressListener.prototype = {
|
||||
aRequest.resume();
|
||||
aRequest = null;
|
||||
this.IUI.closeInspectorUI();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}.bind(this),
|
||||
},
|
||||
{
|
||||
|
@ -5,6 +5,7 @@
|
||||
function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
ignoreAllUncaughtExceptions();
|
||||
|
||||
let doc;
|
||||
let objectNode;
|
||||
|
@ -127,6 +127,7 @@ function finishInspectorTests()
|
||||
function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
ignoreAllUncaughtExceptions();
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
gBrowser.selectedBrowser.addEventListener("load", function() {
|
||||
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
|
||||
|
@ -111,6 +111,7 @@ function inspectorRuleTrap()
|
||||
function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
ignoreAllUncaughtExceptions();
|
||||
|
||||
tab1 = gBrowser.addTab();
|
||||
gBrowser.selectedTab = tab1;
|
||||
|
@ -4,6 +4,7 @@
|
||||
function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
ignoreAllUncaughtExceptions();
|
||||
|
||||
let doc;
|
||||
let nodes;
|
||||
|
@ -218,6 +218,7 @@ function finishInspectorTests()
|
||||
function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
ignoreAllUncaughtExceptions();
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
gBrowser.selectedBrowser.addEventListener("load", function() {
|
||||
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
|
||||
|
@ -213,6 +213,7 @@ function finishUp() {
|
||||
function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
ignoreAllUncaughtExceptions();
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
gBrowser.selectedBrowser.addEventListener("load", function() {
|
||||
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
|
||||
|
@ -137,6 +137,7 @@ function ruleViewOpened2()
|
||||
function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
ignoreAllUncaughtExceptions();
|
||||
|
||||
tab1 = gBrowser.addTab();
|
||||
gBrowser.selectedTab = tab1;
|
||||
|
@ -263,6 +263,7 @@ function inspectorTabUnload1(evt)
|
||||
function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
ignoreAllUncaughtExceptions();
|
||||
|
||||
tab1 = gBrowser.addTab();
|
||||
gBrowser.selectedTab = tab1;
|
||||
|
@ -105,6 +105,7 @@ function finishUp() {
|
||||
function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
ignoreAllUncaughtExceptions();
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
gBrowser.selectedBrowser.addEventListener("load", function() {
|
||||
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
|
||||
|
@ -14,6 +14,7 @@ Cu.import("resource:///modules/devtools/CssHtmlTree.jsm");
|
||||
function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
ignoreAllUncaughtExceptions();
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("load", tabLoaded, true);
|
||||
}
|
||||
|
@ -79,6 +79,7 @@ function finishUp()
|
||||
function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
ignoreAllUncaughtExceptions();
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
gBrowser.selectedBrowser.addEventListener("load", function(evt) {
|
||||
gBrowser.selectedBrowser.removeEventListener(evt.type, arguments.callee, true);
|
||||
|
@ -43,6 +43,7 @@
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-error.html";
|
||||
|
||||
function test() {
|
||||
expectUncaughtException();
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("load", onLoad, true);
|
||||
}
|
||||
|
@ -44,6 +44,7 @@
|
||||
const TEST_DUPLICATE_ERROR_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-duplicate-error.html";
|
||||
|
||||
function test() {
|
||||
expectUncaughtException();
|
||||
addTab(TEST_DUPLICATE_ERROR_URI);
|
||||
browser.addEventListener("DOMContentLoaded", testDuplicateErrors, false);
|
||||
}
|
||||
@ -57,6 +58,7 @@ function testDuplicateErrors() {
|
||||
|
||||
Services.console.registerListener(consoleObserver);
|
||||
|
||||
expectUncaughtException();
|
||||
content.location.reload();
|
||||
}
|
||||
|
||||
|
@ -29,6 +29,7 @@ function contentLoaded(aEvent) {
|
||||
browser.removeEventListener("load", contentLoaded, true);
|
||||
|
||||
let button = content.document.querySelector("button");
|
||||
expectUncaughtException();
|
||||
EventUtils.sendMouseEvent({ type: "click" }, button, content);
|
||||
executeSoon(buttonClicked);
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ function tabLoaded(aEvent) {
|
||||
HUDService.activateHUDForContext(gBrowser.selectedTab);
|
||||
|
||||
gBrowser.selectedBrowser.addEventListener("load", tabReloaded, true);
|
||||
expectUncaughtException();
|
||||
content.location.reload();
|
||||
}
|
||||
|
||||
@ -43,6 +44,7 @@ function tabReloaded(aEvent) {
|
||||
|
||||
newTabIsOpen = true;
|
||||
gBrowser.selectedBrowser.addEventListener("load", tabLoaded, true);
|
||||
expectUncaughtException();
|
||||
content.location = TEST_URI;
|
||||
});
|
||||
}
|
||||
@ -53,6 +55,7 @@ function testEnd() {
|
||||
}
|
||||
|
||||
function test() {
|
||||
expectUncaughtException();
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("load", tabLoaded, true);
|
||||
}
|
||||
|
@ -64,6 +64,7 @@ function test()
|
||||
browser.removeEventListener(aEvent.type, arguments.callee, true);
|
||||
executeSoon(onContentLoaded);
|
||||
}, true);
|
||||
expectUncaughtException();
|
||||
content.location = TEST_URI;
|
||||
}, true);
|
||||
}
|
||||
|
@ -90,6 +90,7 @@ function test()
|
||||
registerCleanupFunction(testEnd);
|
||||
|
||||
executeSoon(function() {
|
||||
expectUncaughtException();
|
||||
content.location = TEST_URI;
|
||||
});
|
||||
}, true);
|
||||
|
@ -25,6 +25,7 @@ function onLoad(aEvent) {
|
||||
|
||||
gHudId = HUDService.getHudIdByWindow(content);
|
||||
browser.addEventListener("load", testWebDevLimits, true);
|
||||
expectUncaughtException();
|
||||
content.location = TEST_URI;
|
||||
}
|
||||
|
||||
@ -70,6 +71,7 @@ function testJsLimits(aEvent) {
|
||||
for (let i = 0; i < 11; i++) {
|
||||
var script = content.document.createElement("script");
|
||||
script.text = "fubar" + i + ".bogus(6);";
|
||||
expectUncaughtException();
|
||||
head.insertBefore(script, head.firstChild);
|
||||
}
|
||||
|
||||
|
@ -417,7 +417,10 @@ function testGen() {
|
||||
networkPanel = HUDService.openNetworkPanel(filterBox, httpActivity);
|
||||
networkPanel.isDoneCallback = function NP_doneCallback() {
|
||||
networkPanel.isDoneCallback = null;
|
||||
testDriver.next();
|
||||
try {
|
||||
testDriver.next();
|
||||
} catch (e if e instanceof StopIteration) {
|
||||
}
|
||||
}
|
||||
|
||||
yield;
|
||||
@ -478,5 +481,5 @@ function testGen() {
|
||||
networkPanel.panel.hidePopup(); */
|
||||
|
||||
// All done!
|
||||
finishTest();
|
||||
finish();
|
||||
}
|
||||
|
@ -7,6 +7,7 @@
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-error.html";
|
||||
|
||||
function test() {
|
||||
expectUncaughtException();
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("DOMContentLoaded", testViewSource, false);
|
||||
}
|
||||
|
@ -1314,24 +1314,24 @@ xpicleanup@BIN_SUFFIX@
|
||||
js3250.dll
|
||||
plugins/npnul32.dll
|
||||
#if _MSC_VER != 1400
|
||||
@BINPATH@/Microsoft.VC80.CRT.manifest
|
||||
@BINPATH@/msvcm80.dll
|
||||
@BINPATH@/msvcp80.dll
|
||||
@BINPATH@/msvcr80.dll
|
||||
Microsoft.VC80.CRT.manifest
|
||||
msvcm80.dll
|
||||
msvcp80.dll
|
||||
msvcr80.dll
|
||||
#endif
|
||||
#if _MSC_VER != 1500
|
||||
@BINPATH@/Microsoft.VC90.CRT.manifest
|
||||
@BINPATH@/msvcm90.dll
|
||||
@BINPATH@/msvcp90.dll
|
||||
@BINPATH@/msvcr90.dll
|
||||
Microsoft.VC90.CRT.manifest
|
||||
msvcm90.dll
|
||||
msvcp90.dll
|
||||
msvcr90.dll
|
||||
#endif
|
||||
#if _MSC_VER != 1600
|
||||
@BINPATH@/msvcp100.dll
|
||||
@BINPATH@/msvcr100.dll
|
||||
msvcp100.dll
|
||||
msvcr100.dll
|
||||
#endif
|
||||
#if _MSC_VER != 1700
|
||||
@BINPATH@/msvcp110.dll
|
||||
@BINPATH@/msvcr110.dll
|
||||
msvcp110.dll
|
||||
msvcr110.dll
|
||||
#endif
|
||||
mozcrt19.dll
|
||||
mozcpp19.dll
|
||||
|
@ -9,8 +9,6 @@
|
||||
<!ENTITY importFromIE.accesskey "M">
|
||||
<!ENTITY importFromNothing.label "Don't import anything">
|
||||
<!ENTITY importFromNothing.accesskey "D">
|
||||
<!ENTITY importFromSeamonkey.label "Netscape 6, 7 or Mozilla 1.x">
|
||||
<!ENTITY importFromSeamonkey.accesskey "N">
|
||||
<!ENTITY importFromOpera.label "Opera">
|
||||
<!ENTITY importFromOpera.accesskey "O">
|
||||
<!ENTITY importFromSafari.label "Safari">
|
||||
|
@ -2,7 +2,6 @@ profileName_format=%S %S
|
||||
|
||||
# Browser Specific
|
||||
sourceNameIE=Internet Explorer
|
||||
sourceNameSeamonkey=Netscape 6/7/Mozilla
|
||||
sourceNameOpera=Opera
|
||||
sourceNameSafari=Safari
|
||||
sourceNameChrome=Google Chrome
|
||||
@ -12,7 +11,6 @@ importedSearchURLsFolder=Keyword Searches (From %S)
|
||||
importedSearchURLsTitle=Search on %S
|
||||
importedSearchUrlDesc=Type "%S <search query>" in the Location Bar to perform a search on %S.
|
||||
|
||||
importedSeamonkeyBookmarksTitle=From Netscape 6/7/Mozilla
|
||||
importedSafariBookmarks=From Safari
|
||||
importedOperaHotlistTitle=From Opera
|
||||
importedOperaSearchUrls=Keyword Searches (From Opera)
|
||||
@ -20,43 +18,36 @@ importedOperaSearchUrls=Keyword Searches (From Opera)
|
||||
# Import Sources
|
||||
1_ie=Internet Options
|
||||
1_opera=Preferences
|
||||
1_seamonkey=Preferences
|
||||
1_safari=Preferences
|
||||
1_chrome=Preferences
|
||||
|
||||
2_ie=Cookies
|
||||
2_opera=Cookies
|
||||
2_seamonkey=Cookies
|
||||
2_safari=Cookies
|
||||
2_chrome=Cookies
|
||||
|
||||
4_ie=Browsing History
|
||||
4_opera=Browsing History
|
||||
4_seamonkey=Browsing History
|
||||
4_safari=Browsing History
|
||||
4_chrome=Browsing History
|
||||
|
||||
8_ie=Saved Form History
|
||||
8_opera=Saved Form History
|
||||
8_seamonkey=Saved Form History
|
||||
8_safari=Saved Form History
|
||||
8_chrome=Saved Form History
|
||||
|
||||
16_ie=Saved Passwords
|
||||
16_opera=Saved Passwords
|
||||
16_seamonkey=Saved Passwords
|
||||
16_safari=Saved Passwords
|
||||
16_chrome=Saved Passwords
|
||||
|
||||
32_ie=Favorites
|
||||
32_opera=Bookmarks
|
||||
32_seamonkey=Bookmarks
|
||||
32_safari=Bookmarks
|
||||
32_chrome=Bookmarks
|
||||
|
||||
64_ie=Other Data
|
||||
64_opera=Other Data
|
||||
64_seamonkey=Other Data
|
||||
64_safari=Other Data
|
||||
64_chrome=Other Data
|
||||
|
||||
|
@ -1,4 +1,8 @@
|
||||
tabview.groupItem.defaultName=Name this tab group…
|
||||
tabview.button.searchTabs=Search tab groups
|
||||
tabview.button.exitTabGroups=Exit tab groups
|
||||
tabview.groupItem.defaultName=Name this tab group
|
||||
tabview.groupItem.closeGroup=Close group
|
||||
tabview.groupItem.undoCloseGroup=Undo Close Group
|
||||
tabview.groupItem.discardClosedGroup=Discard closed group
|
||||
tabview.search.otherWindowTabs=Tabs from other windows
|
||||
tabview.notification.sessionStore=Tabs and groups will automatically be restored the next time you start %S.
|
||||
|
@ -4364,7 +4364,7 @@ MOZ_ARG_WITH_BOOL(system-nss,
|
||||
_USE_SYSTEM_NSS=1 )
|
||||
|
||||
if test -n "$_USE_SYSTEM_NSS"; then
|
||||
AM_PATH_NSS(3.13.1, [MOZ_NATIVE_NSS=1], [AC_MSG_ERROR([you don't have NSS installed or your version is too old])])
|
||||
AM_PATH_NSS(3.13.2, [MOZ_NATIVE_NSS=1], [AC_MSG_ERROR([you don't have NSS installed or your version is too old])])
|
||||
fi
|
||||
|
||||
if test -n "$MOZ_NATIVE_NSS"; then
|
||||
|
@ -84,8 +84,6 @@ VideoDocument::StartDocumentLoad(const char* aCommand,
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
mStreamListener = new MediaDocumentStreamListener(this);
|
||||
if (!mStreamListener)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
// Create synthetic document
|
||||
rv = CreateSyntheticVideoDocument(aChannel,
|
||||
@ -158,7 +156,6 @@ nsresult
|
||||
NS_NewVideoDocument(nsIDocument** aResult)
|
||||
{
|
||||
mozilla::dom::VideoDocument* doc = new mozilla::dom::VideoDocument();
|
||||
NS_ENSURE_TRUE(doc, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
NS_ADDREF(doc);
|
||||
nsresult rv = doc->Init();
|
||||
|
@ -1077,7 +1077,7 @@ nsMediaCache::PredictNextUseForIncomingData(nsMediaCacheStream* aStream)
|
||||
NS_MIN<PRInt64>(millisecondsAhead, PR_INT32_MAX));
|
||||
}
|
||||
|
||||
enum StreamAction { NONE, SEEK, RESUME, SUSPEND };
|
||||
enum StreamAction { NONE, SEEK, SEEK_AND_RESUME, RESUME, SUSPEND };
|
||||
|
||||
void
|
||||
nsMediaCache::Update()
|
||||
@ -1322,7 +1322,7 @@ nsMediaCache::Update()
|
||||
// because we don't want to think we have part of a block already
|
||||
// in mPartialBlockBuffer.
|
||||
stream->mChannelOffset = (desiredOffset/BLOCK_SIZE)*BLOCK_SIZE;
|
||||
actions[i] = SEEK;
|
||||
actions[i] = stream->mCacheSuspended ? SEEK_AND_RESUME : SEEK;
|
||||
} else if (enableReading && stream->mCacheSuspended) {
|
||||
actions[i] = RESUME;
|
||||
} else if (!enableReading && !stream->mCacheSuspended) {
|
||||
@ -1339,38 +1339,55 @@ nsMediaCache::Update()
|
||||
// other cache state. That's OK, they'll trigger new Update events and we'll
|
||||
// get back here and revise our decisions. The important thing here is that
|
||||
// performing these actions only depends on mChannelOffset and
|
||||
// mCacheSuspended, which can only be written by the main thread (i.e., this
|
||||
// the action, which can only be written by the main thread (i.e., this
|
||||
// thread), so we don't have races here.
|
||||
|
||||
// First, update the mCacheSuspended/mCacheEnded flags so that they're all correct
|
||||
// when we fire our CacheClient commands below. Those commands can rely on these flags
|
||||
// being set correctly for all streams.
|
||||
for (PRUint32 i = 0; i < mStreams.Length(); ++i) {
|
||||
nsMediaCacheStream* stream = mStreams[i];
|
||||
nsresult rv = NS_OK;
|
||||
switch (actions[i]) {
|
||||
case SEEK:
|
||||
LOG(PR_LOG_DEBUG, ("Stream %p CacheSeek to %lld (resume=%d)", stream,
|
||||
(long long)stream->mChannelOffset, stream->mCacheSuspended));
|
||||
rv = stream->mClient->CacheClientSeek(stream->mChannelOffset,
|
||||
stream->mCacheSuspended);
|
||||
case SEEK_AND_RESUME:
|
||||
stream->mCacheSuspended = false;
|
||||
stream->mChannelEnded = false;
|
||||
break;
|
||||
|
||||
case RESUME:
|
||||
LOG(PR_LOG_DEBUG, ("Stream %p Resumed", stream));
|
||||
rv = stream->mClient->CacheClientResume();
|
||||
stream->mCacheSuspended = false;
|
||||
break;
|
||||
|
||||
case SUSPEND:
|
||||
LOG(PR_LOG_DEBUG, ("Stream %p Suspended", stream));
|
||||
rv = stream->mClient->CacheClientSuspend();
|
||||
stream->mCacheSuspended = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
stream->mHasHadUpdate = true;
|
||||
}
|
||||
|
||||
for (PRUint32 i = 0; i < mStreams.Length(); ++i) {
|
||||
nsMediaCacheStream* stream = mStreams[i];
|
||||
nsresult rv;
|
||||
switch (actions[i]) {
|
||||
case SEEK:
|
||||
case SEEK_AND_RESUME:
|
||||
LOG(PR_LOG_DEBUG, ("Stream %p CacheSeek to %lld (resume=%d)", stream,
|
||||
(long long)stream->mChannelOffset, actions[i] == SEEK_AND_RESUME));
|
||||
rv = stream->mClient->CacheClientSeek(stream->mChannelOffset,
|
||||
actions[i] == SEEK_AND_RESUME);
|
||||
break;
|
||||
case RESUME:
|
||||
LOG(PR_LOG_DEBUG, ("Stream %p Resumed", stream));
|
||||
rv = stream->mClient->CacheClientResume();
|
||||
break;
|
||||
case SUSPEND:
|
||||
LOG(PR_LOG_DEBUG, ("Stream %p Suspended", stream));
|
||||
rv = stream->mClient->CacheClientSuspend();
|
||||
break;
|
||||
default:
|
||||
rv = NS_OK;
|
||||
break;
|
||||
}
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
// Close the streams that failed due to error. This will cause all
|
||||
|
@ -766,7 +766,7 @@ nsMediaChannelStream::CacheClientSeek(PRInt64 aOffset, bool aResume)
|
||||
{
|
||||
NS_ASSERTION(NS_IsMainThread(), "Don't call on non-main thread");
|
||||
|
||||
printf("*** nsMediaChannelStream::CacheClientSeek() mDecoder=%p\n", mDecoder);
|
||||
printf("*** nsMediaChannelStream::CacheClientSeek() mDecoder=%p aOffset=%lld aResume = %d\n", mDecoder, (long long)aOffset, aResume);
|
||||
|
||||
CloseChannel();
|
||||
|
||||
|
@ -79,6 +79,7 @@ endif # WINNT
|
||||
LOCAL_INCLUDES = -I$(srcdir)/../include
|
||||
|
||||
FORCE_STATIC_LIB = 1
|
||||
FORCE_USE_PIC = 1
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
|
6
dom/base/crashtests/706283-1.html
Normal file
6
dom/base/crashtests/706283-1.html
Normal file
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<script>
|
||||
|
||||
window.mozRequestAnimationFrame(null);
|
||||
|
||||
</script>
|
@ -32,3 +32,4 @@ load 675621-1.html
|
||||
load 693894.html
|
||||
load 695867.html
|
||||
load 697643.html
|
||||
load 706283-1.html
|
||||
|
@ -1327,6 +1327,7 @@ nsDOMWindowUtils::SendQueryContentEvent(PRUint32 aType,
|
||||
nsIntRect widgetBounds;
|
||||
nsresult rv = widget->GetClientBounds(widgetBounds);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
widgetBounds.MoveTo(0, 0);
|
||||
|
||||
// There is no popup frame at the point and the point isn't in our widget,
|
||||
// we cannot process this request.
|
||||
|
@ -3883,6 +3883,10 @@ nsGlobalWindow::MozRequestAnimationFrame(nsIFrameRequestCallback* aCallback)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (!aCallback) {
|
||||
return NS_ERROR_XPC_BAD_CONVERT_JS;
|
||||
}
|
||||
|
||||
mDoc->ScheduleFrameRequestCallback(aCallback);
|
||||
return NS_OK;
|
||||
}
|
||||
@ -10320,7 +10324,7 @@ nsGlobalChromeWindow::BeginWindowMove(nsIDOMEvent *aMouseDownEvent, nsIDOMElemen
|
||||
nsIFrame* frame = panel->GetPrimaryFrame();
|
||||
NS_ENSURE_TRUE(frame && frame->GetType() == nsGkAtoms::menuPopupFrame, NS_OK);
|
||||
|
||||
(static_cast<nsMenuPopupFrame*>(frame))->GetWidget(getter_AddRefs(widget));
|
||||
widget = (static_cast<nsMenuPopupFrame*>(frame))->GetWidget();
|
||||
}
|
||||
else {
|
||||
#endif
|
||||
|
@ -225,8 +225,7 @@ ContentParent::Init()
|
||||
nsCOMPtr<nsIThreadInternal>
|
||||
threadInt(do_QueryInterface(NS_GetCurrentThread()));
|
||||
if (threadInt) {
|
||||
threadInt->GetObserver(getter_AddRefs(mOldObserver));
|
||||
threadInt->SetObserver(this);
|
||||
threadInt->AddObserver(this);
|
||||
}
|
||||
if (obs) {
|
||||
obs->NotifyObservers(static_cast<nsIObserver*>(this), "ipc:content-created", nsnull);
|
||||
@ -344,7 +343,7 @@ ContentParent::ActorDestroy(ActorDestroyReason why)
|
||||
nsCOMPtr<nsIThreadInternal>
|
||||
threadInt(do_QueryInterface(NS_GetCurrentThread()));
|
||||
if (threadInt)
|
||||
threadInt->SetObserver(mOldObserver);
|
||||
threadInt->RemoveObserver(this);
|
||||
if (mRunToCompletionDepth)
|
||||
mRunToCompletionDepth = 0;
|
||||
|
||||
@ -1118,11 +1117,9 @@ ContentParent::RecvLoadURIExternal(const IPC::URI& uri)
|
||||
/* void onDispatchedEvent (in nsIThreadInternal thread); */
|
||||
NS_IMETHODIMP
|
||||
ContentParent::OnDispatchedEvent(nsIThreadInternal *thread)
|
||||
{
|
||||
if (mOldObserver)
|
||||
return mOldObserver->OnDispatchedEvent(thread);
|
||||
|
||||
return NS_OK;
|
||||
{
|
||||
NS_NOTREACHED("OnDispatchedEvent unimplemented");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/* void onProcessNextEvent (in nsIThreadInternal thread, in boolean mayWait, in unsigned long recursionDepth); */
|
||||
@ -1134,9 +1131,6 @@ ContentParent::OnProcessNextEvent(nsIThreadInternal *thread,
|
||||
if (mRunToCompletionDepth)
|
||||
++mRunToCompletionDepth;
|
||||
|
||||
if (mOldObserver)
|
||||
return mOldObserver->OnProcessNextEvent(thread, mayWait, recursionDepth);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -1156,9 +1150,6 @@ ContentParent::AfterProcessNextEvent(nsIThreadInternal *thread,
|
||||
}
|
||||
}
|
||||
|
||||
if (mOldObserver)
|
||||
return mOldObserver->AfterProcessNextEvent(thread, recursionDepth);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -235,7 +235,6 @@ private:
|
||||
PRInt32 mGeolocationWatchID;
|
||||
int mRunToCompletionDepth;
|
||||
bool mShouldCallUnblockChild;
|
||||
nsCOMPtr<nsIThreadObserver> mOldObserver;
|
||||
|
||||
// This is a cache of all of the memory reporters
|
||||
// registered in the child process. To update this, one
|
||||
|
@ -73,6 +73,7 @@ using mozilla::dom::StorageChild;
|
||||
#include "nsNetCID.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
|
||||
// calls FlushAndDeleteTemporaryTables(false)
|
||||
#define NS_DOMSTORAGE_FLUSH_TIMER_TOPIC "domstorage-flush-timer"
|
||||
@ -1601,6 +1602,40 @@ nsDOMStorage::GetItem(const nsAString& aKey, nsAString &aData)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
static Telemetry::ID
|
||||
TelemetryIDForKey(nsPIDOMStorage::nsDOMStorageType type)
|
||||
{
|
||||
switch (type) {
|
||||
default:
|
||||
MOZ_ASSERT(false);
|
||||
// We need to return something to satisfy the compiler.
|
||||
// Fallthrough.
|
||||
case nsPIDOMStorage::GlobalStorage:
|
||||
return Telemetry::GLOBALDOMSTORAGE_KEY_SIZE_BYTES;
|
||||
case nsPIDOMStorage::LocalStorage:
|
||||
return Telemetry::LOCALDOMSTORAGE_KEY_SIZE_BYTES;
|
||||
case nsPIDOMStorage::SessionStorage:
|
||||
return Telemetry::SESSIONDOMSTORAGE_KEY_SIZE_BYTES;
|
||||
}
|
||||
}
|
||||
|
||||
static Telemetry::ID
|
||||
TelemetryIDForValue(nsPIDOMStorage::nsDOMStorageType type)
|
||||
{
|
||||
switch (type) {
|
||||
default:
|
||||
MOZ_ASSERT(false);
|
||||
// We need to return something to satisfy the compiler.
|
||||
// Fallthrough.
|
||||
case nsPIDOMStorage::GlobalStorage:
|
||||
return Telemetry::GLOBALDOMSTORAGE_VALUE_SIZE_BYTES;
|
||||
case nsPIDOMStorage::LocalStorage:
|
||||
return Telemetry::LOCALDOMSTORAGE_VALUE_SIZE_BYTES;
|
||||
case nsPIDOMStorage::SessionStorage:
|
||||
return Telemetry::SESSIONDOMSTORAGE_VALUE_SIZE_BYTES;
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMStorage::GetItem(const nsAString& aKey, nsIDOMStorageItem **aItem)
|
||||
{
|
||||
@ -1617,6 +1652,9 @@ nsDOMStorage::SetItem(const nsAString& aKey, const nsAString& aData)
|
||||
if (!CacheStoragePermissions())
|
||||
return NS_ERROR_DOM_SECURITY_ERR;
|
||||
|
||||
Telemetry::Accumulate(TelemetryIDForKey(mStorageType), aKey.Length());
|
||||
Telemetry::Accumulate(TelemetryIDForValue(mStorageType), aData.Length());
|
||||
|
||||
nsString oldValue;
|
||||
nsresult rv = mStorageImpl->SetValue(IsCallerSecure(), aKey, aData, oldValue);
|
||||
if (NS_FAILED(rv))
|
||||
|
@ -13,15 +13,34 @@ function run_test()
|
||||
testURI(Services.io.newURI("moz-safe-about:rights", null, null));
|
||||
}
|
||||
|
||||
function sum(a)
|
||||
{
|
||||
return a.reduce(function(prev, current, index, array) {
|
||||
return prev + current;
|
||||
});
|
||||
}
|
||||
|
||||
function testURI(aURI)
|
||||
{
|
||||
print("Testing: " + aURI.spec);
|
||||
let storage = getStorageForURI(aURI);
|
||||
let Telemetry = Components.classes["@mozilla.org/base/telemetry;1"].
|
||||
getService(Components.interfaces.nsITelemetry);
|
||||
let key_histogram = Telemetry.getHistogramById("LOCALDOMSTORAGE_KEY_SIZE_BYTES");
|
||||
let value_histogram = Telemetry.getHistogramById("LOCALDOMSTORAGE_VALUE_SIZE_BYTES");
|
||||
let before_key_snapshot = key_histogram.snapshot();
|
||||
let before_value_snapshot = value_histogram.snapshot();
|
||||
storage.setItem("test-item", "test-value");
|
||||
print("Check that our value has been correctly stored.");
|
||||
let after_key_snapshot = key_histogram.snapshot();
|
||||
let after_value_snapshot = value_histogram.snapshot();
|
||||
do_check_eq(storage.length, 1);
|
||||
do_check_eq(storage.key(0), "test-item");
|
||||
do_check_eq(storage.getItem("test-item"), "test-value");
|
||||
do_check_eq(sum(after_key_snapshot.counts),
|
||||
sum(before_key_snapshot.counts)+1);
|
||||
do_check_eq(sum(after_value_snapshot.counts),
|
||||
sum(before_value_snapshot.counts)+1);
|
||||
|
||||
print("Check that our value is correctly removed.");
|
||||
storage.removeItem("test-item");
|
||||
|
@ -139,6 +139,9 @@ JSBool
|
||||
EventTarget::AddEventListener(JSContext* aCx, uintN aArgc, jsval* aVp)
|
||||
{
|
||||
JSObject* obj = JS_THIS_OBJECT(aCx, aVp);
|
||||
if (!obj) {
|
||||
return true;
|
||||
}
|
||||
|
||||
EventTarget* self = GetPrivate(aCx, obj);
|
||||
if (!self) {
|
||||
@ -167,6 +170,9 @@ JSBool
|
||||
EventTarget::RemoveEventListener(JSContext* aCx, uintN aArgc, jsval* aVp)
|
||||
{
|
||||
JSObject* obj = JS_THIS_OBJECT(aCx, aVp);
|
||||
if (!obj) {
|
||||
return true;
|
||||
}
|
||||
|
||||
EventTarget* self = GetPrivate(aCx, obj);
|
||||
if (!self) {
|
||||
@ -195,6 +201,9 @@ JSBool
|
||||
EventTarget::DispatchEvent(JSContext* aCx, uintN aArgc, jsval* aVp)
|
||||
{
|
||||
JSObject* obj = JS_THIS_OBJECT(aCx, aVp);
|
||||
if (!obj) {
|
||||
return true;
|
||||
}
|
||||
|
||||
EventTarget* self = GetPrivate(aCx, obj);
|
||||
if (!self) {
|
||||
|
@ -317,6 +317,9 @@ private:
|
||||
StopPropagation(JSContext* aCx, uintN aArgc, jsval* aVp)
|
||||
{
|
||||
JSObject* obj = JS_THIS_OBJECT(aCx, aVp);
|
||||
if (!obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Event* event = GetInstancePrivate(aCx, obj, sFunctions[0].name);
|
||||
if (!event) {
|
||||
@ -332,6 +335,9 @@ private:
|
||||
StopImmediatePropagation(JSContext* aCx, uintN aArgc, jsval* aVp)
|
||||
{
|
||||
JSObject* obj = JS_THIS_OBJECT(aCx, aVp);
|
||||
if (!obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Event* event = GetInstancePrivate(aCx, obj, sFunctions[3].name);
|
||||
if (!event) {
|
||||
@ -347,6 +353,9 @@ private:
|
||||
PreventDefault(JSContext* aCx, uintN aArgc, jsval* aVp)
|
||||
{
|
||||
JSObject* obj = JS_THIS_OBJECT(aCx, aVp);
|
||||
if (!obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Event* event = GetInstancePrivate(aCx, obj, sFunctions[1].name);
|
||||
if (!event) {
|
||||
@ -367,6 +376,9 @@ private:
|
||||
InitEvent(JSContext* aCx, uintN aArgc, jsval* aVp)
|
||||
{
|
||||
JSObject* obj = JS_THIS_OBJECT(aCx, aVp);
|
||||
if (!obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Event* event = GetInstancePrivate(aCx, obj, sFunctions[2].name);
|
||||
if (!event) {
|
||||
@ -627,6 +639,9 @@ private:
|
||||
InitMessageEvent(JSContext* aCx, uintN aArgc, jsval* aVp)
|
||||
{
|
||||
JSObject* obj = JS_THIS_OBJECT(aCx, aVp);
|
||||
if (!obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
MessageEvent* event = GetInstancePrivate(aCx, obj, sFunctions[0].name);
|
||||
if (!event) {
|
||||
@ -823,6 +838,9 @@ private:
|
||||
InitErrorEvent(JSContext* aCx, uintN aArgc, jsval* aVp)
|
||||
{
|
||||
JSObject* obj = JS_THIS_OBJECT(aCx, aVp);
|
||||
if (!obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ErrorEvent* event = GetInstancePrivate(aCx, obj, sFunctions[0].name);
|
||||
if (!event) {
|
||||
@ -1010,6 +1028,9 @@ private:
|
||||
InitProgressEvent(JSContext* aCx, uintN aArgc, jsval* aVp)
|
||||
{
|
||||
JSObject* obj = JS_THIS_OBJECT(aCx, aVp);
|
||||
if (!obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ProgressEvent* event = GetInstancePrivate(aCx, obj, sFunctions[0].name);
|
||||
if (!event) {
|
||||
|
@ -122,6 +122,9 @@ private:
|
||||
ToString(JSContext* aCx, uintN aArgc, jsval* aVp)
|
||||
{
|
||||
JSObject* obj = JS_THIS_OBJECT(aCx, aVp);
|
||||
if (!obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
JSClass* classPtr;
|
||||
if (!obj || ((classPtr = JS_GET_CLASS(aCx, obj)) != &sClass)) {
|
||||
|
@ -185,6 +185,9 @@ private:
|
||||
MozSlice(JSContext* aCx, uintN aArgc, jsval* aVp)
|
||||
{
|
||||
JSObject* obj = JS_THIS_OBJECT(aCx, aVp);
|
||||
if (!obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
nsIDOMBlob* blob = GetInstancePrivate(aCx, obj, "mozSlice");
|
||||
if (!blob) {
|
||||
|
@ -180,6 +180,9 @@ private:
|
||||
ReadAsArrayBuffer(JSContext* aCx, uintN aArgc, jsval* aVp)
|
||||
{
|
||||
JSObject* obj = JS_THIS_OBJECT(aCx, aVp);
|
||||
if (!obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
FileReaderSyncPrivate* fileReader =
|
||||
GetInstancePrivate(aCx, obj, "readAsArrayBuffer");
|
||||
@ -224,6 +227,9 @@ private:
|
||||
ReadAsDataURL(JSContext* aCx, uintN aArgc, jsval* aVp)
|
||||
{
|
||||
JSObject* obj = JS_THIS_OBJECT(aCx, aVp);
|
||||
if (!obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
FileReaderSyncPrivate* fileReader =
|
||||
GetInstancePrivate(aCx, obj, "readAsDataURL");
|
||||
@ -261,6 +267,9 @@ private:
|
||||
ReadAsBinaryString(JSContext* aCx, uintN aArgc, jsval* aVp)
|
||||
{
|
||||
JSObject* obj = JS_THIS_OBJECT(aCx, aVp);
|
||||
if (!obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
FileReaderSyncPrivate* fileReader =
|
||||
GetInstancePrivate(aCx, obj, "readAsBinaryString");
|
||||
@ -298,6 +307,9 @@ private:
|
||||
ReadAsText(JSContext* aCx, uintN aArgc, jsval* aVp)
|
||||
{
|
||||
JSObject* obj = JS_THIS_OBJECT(aCx, aVp);
|
||||
if (!obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
FileReaderSyncPrivate* fileReader =
|
||||
GetInstancePrivate(aCx, obj, "readAsText");
|
||||
|
@ -267,6 +267,9 @@ private:
|
||||
Terminate(JSContext* aCx, uintN aArgc, jsval* aVp)
|
||||
{
|
||||
JSObject* obj = JS_THIS_OBJECT(aCx, aVp);
|
||||
if (!obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const char*& name = sFunctions[0].name;
|
||||
WorkerPrivate* worker = GetInstancePrivate(aCx, obj, name);
|
||||
@ -281,6 +284,9 @@ private:
|
||||
PostMessage(JSContext* aCx, uintN aArgc, jsval* aVp)
|
||||
{
|
||||
JSObject* obj = JS_THIS_OBJECT(aCx, aVp);
|
||||
if (!obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const char*& name = sFunctions[1].name;
|
||||
WorkerPrivate* worker = GetInstancePrivate(aCx, obj, name);
|
||||
|
@ -386,6 +386,9 @@ private:
|
||||
Close(JSContext* aCx, uintN aArgc, jsval* aVp)
|
||||
{
|
||||
JSObject* obj = JS_THIS_OBJECT(aCx, aVp);
|
||||
if (!obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
WorkerGlobalScope* scope = GetInstancePrivate(aCx, obj, sFunctions[0].name);
|
||||
if (!scope) {
|
||||
@ -399,6 +402,9 @@ private:
|
||||
ImportScripts(JSContext* aCx, uintN aArgc, jsval* aVp)
|
||||
{
|
||||
JSObject* obj = JS_THIS_OBJECT(aCx, aVp);
|
||||
if (!obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
WorkerGlobalScope* scope = GetInstancePrivate(aCx, obj, sFunctions[1].name);
|
||||
if (!scope) {
|
||||
@ -416,6 +422,9 @@ private:
|
||||
SetTimeout(JSContext* aCx, uintN aArgc, jsval* aVp)
|
||||
{
|
||||
JSObject* obj = JS_THIS_OBJECT(aCx, aVp);
|
||||
if (!obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
WorkerGlobalScope* scope = GetInstancePrivate(aCx, obj, sFunctions[2].name);
|
||||
if (!scope) {
|
||||
@ -434,6 +443,9 @@ private:
|
||||
ClearTimeout(JSContext* aCx, uintN aArgc, jsval* aVp)
|
||||
{
|
||||
JSObject* obj = JS_THIS_OBJECT(aCx, aVp);
|
||||
if (!obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
WorkerGlobalScope* scope = GetInstancePrivate(aCx, obj, sFunctions[3].name);
|
||||
if (!scope) {
|
||||
@ -452,6 +464,9 @@ private:
|
||||
SetInterval(JSContext* aCx, uintN aArgc, jsval* aVp)
|
||||
{
|
||||
JSObject* obj = JS_THIS_OBJECT(aCx, aVp);
|
||||
if (!obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
WorkerGlobalScope* scope = GetInstancePrivate(aCx, obj, sFunctions[4].name);
|
||||
if (!scope) {
|
||||
@ -470,6 +485,9 @@ private:
|
||||
ClearInterval(JSContext* aCx, uintN aArgc, jsval* aVp)
|
||||
{
|
||||
JSObject* obj = JS_THIS_OBJECT(aCx, aVp);
|
||||
if (!obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
WorkerGlobalScope* scope = GetInstancePrivate(aCx, obj, sFunctions[5].name);
|
||||
if (!scope) {
|
||||
@ -487,8 +505,12 @@ private:
|
||||
static JSBool
|
||||
Dump(JSContext* aCx, uintN aArgc, jsval* aVp)
|
||||
{
|
||||
if (!GetInstancePrivate(aCx, JS_THIS_OBJECT(aCx, aVp),
|
||||
sFunctions[6].name)) {
|
||||
JSObject* obj = JS_THIS_OBJECT(aCx, aVp);
|
||||
if (!obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!GetInstancePrivate(aCx, obj, sFunctions[6].name)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -513,8 +535,12 @@ private:
|
||||
static JSBool
|
||||
AtoB(JSContext* aCx, uintN aArgc, jsval* aVp)
|
||||
{
|
||||
if (!GetInstancePrivate(aCx, JS_THIS_OBJECT(aCx, aVp),
|
||||
sFunctions[7].name)) {
|
||||
JSObject* obj = JS_THIS_OBJECT(aCx, aVp);
|
||||
if (!obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!GetInstancePrivate(aCx, obj, sFunctions[7].name)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -535,8 +561,12 @@ private:
|
||||
static JSBool
|
||||
BtoA(JSContext* aCx, uintN aArgc, jsval* aVp)
|
||||
{
|
||||
if (!GetInstancePrivate(aCx, JS_THIS_OBJECT(aCx, aVp),
|
||||
sFunctions[8].name)) {
|
||||
JSObject* obj = JS_THIS_OBJECT(aCx, aVp);
|
||||
if (!obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!GetInstancePrivate(aCx, obj, sFunctions[8].name)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -754,6 +784,9 @@ private:
|
||||
PostMessage(JSContext* aCx, uintN aArgc, jsval* aVp)
|
||||
{
|
||||
JSObject* obj = JS_THIS_OBJECT(aCx, aVp);
|
||||
if (!obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const char*& name = sFunctions[0].name;
|
||||
DedicatedWorkerGlobalScope* scope = GetInstancePrivate(aCx, obj, name);
|
||||
|
@ -605,6 +605,9 @@ private:
|
||||
Abort(JSContext* aCx, uintN aArgc, jsval* aVp)
|
||||
{
|
||||
JSObject* obj = JS_THIS_OBJECT(aCx, aVp);
|
||||
if (!obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
XMLHttpRequestPrivate* priv =
|
||||
GetInstancePrivate(aCx, obj, sFunctions[0].name);
|
||||
@ -619,6 +622,9 @@ private:
|
||||
GetAllResponseHeaders(JSContext* aCx, uintN aArgc, jsval* aVp)
|
||||
{
|
||||
JSObject* obj = JS_THIS_OBJECT(aCx, aVp);
|
||||
if (!obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
XMLHttpRequestPrivate* priv =
|
||||
GetInstancePrivate(aCx, obj, sFunctions[1].name);
|
||||
@ -639,6 +645,9 @@ private:
|
||||
GetResponseHeader(JSContext* aCx, uintN aArgc, jsval* aVp)
|
||||
{
|
||||
JSObject* obj = JS_THIS_OBJECT(aCx, aVp);
|
||||
if (!obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
XMLHttpRequestPrivate* priv =
|
||||
GetInstancePrivate(aCx, obj, sFunctions[2].name);
|
||||
@ -675,6 +684,9 @@ private:
|
||||
Open(JSContext* aCx, uintN aArgc, jsval* aVp)
|
||||
{
|
||||
JSObject* obj = JS_THIS_OBJECT(aCx, aVp);
|
||||
if (!obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
XMLHttpRequestPrivate* priv =
|
||||
GetInstancePrivate(aCx, obj, sFunctions[3].name);
|
||||
@ -698,6 +710,9 @@ private:
|
||||
Send(JSContext* aCx, uintN aArgc, jsval* aVp)
|
||||
{
|
||||
JSObject* obj = JS_THIS_OBJECT(aCx, aVp);
|
||||
if (!obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
XMLHttpRequestPrivate* priv =
|
||||
GetInstancePrivate(aCx, obj, sFunctions[4].name);
|
||||
@ -714,6 +729,9 @@ private:
|
||||
SendAsBinary(JSContext* aCx, uintN aArgc, jsval* aVp)
|
||||
{
|
||||
JSObject* obj = JS_THIS_OBJECT(aCx, aVp);
|
||||
if (!obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
XMLHttpRequestPrivate* priv =
|
||||
GetInstancePrivate(aCx, obj, sFunctions[5].name);
|
||||
@ -744,6 +762,9 @@ private:
|
||||
SetRequestHeader(JSContext* aCx, uintN aArgc, jsval* aVp)
|
||||
{
|
||||
JSObject* obj = JS_THIS_OBJECT(aCx, aVp);
|
||||
if (!obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
XMLHttpRequestPrivate* priv =
|
||||
GetInstancePrivate(aCx, obj, sFunctions[6].name);
|
||||
@ -764,6 +785,9 @@ private:
|
||||
OverrideMimeType(JSContext* aCx, uintN aArgc, jsval* aVp)
|
||||
{
|
||||
JSObject* obj = JS_THIS_OBJECT(aCx, aVp);
|
||||
if (!obj) {
|
||||
return false;
|
||||
}
|
||||
|
||||
XMLHttpRequestPrivate* priv =
|
||||
GetInstancePrivate(aCx, obj, sFunctions[7].name);
|
||||
|
@ -2498,14 +2498,16 @@ GLContext::SetBlitFramebufferForDestTexture(GLuint aTexture)
|
||||
aTexture,
|
||||
0);
|
||||
|
||||
if (aTexture && (fCheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER) !=
|
||||
LOCAL_GL_FRAMEBUFFER_COMPLETE)) {
|
||||
|
||||
GLenum result = fCheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER);
|
||||
if (aTexture && (result != LOCAL_GL_FRAMEBUFFER_COMPLETE)) {
|
||||
nsCAutoString msg;
|
||||
msg.Append("Framebuffer not complete -- error 0x");
|
||||
msg.AppendInt(result, 16);
|
||||
// Note: if you are hitting this, it is likely that
|
||||
// your texture is not texture complete -- that is, you
|
||||
// allocated a texture name, but didn't actually define its
|
||||
// size via a call to TexImage2D.
|
||||
NS_RUNTIMEABORT("Error setting up framebuffer --- framebuffer not complete!");
|
||||
NS_RUNTIMEABORT(msg.get());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1000,9 +1000,12 @@ LayerManagerOGL::SetupBackBuffer(int aWidth, int aHeight)
|
||||
mBackBufferTexture,
|
||||
0);
|
||||
|
||||
if (mGLContext->fCheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER) !=
|
||||
LOCAL_GL_FRAMEBUFFER_COMPLETE) {
|
||||
NS_RUNTIMEABORT("Error setting up framebuffer --- framebuffer not complete");
|
||||
GLenum result = mGLContext->fCheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER);
|
||||
if (result != LOCAL_GL_FRAMEBUFFER_COMPLETE) {
|
||||
nsCAutoString msg;
|
||||
msg.Append("Framebuffer not complete -- error 0x");
|
||||
msg.AppendInt(result, 16);
|
||||
NS_RUNTIMEABORT(msg.get());
|
||||
}
|
||||
|
||||
mBackBufferSize.width = aWidth;
|
||||
@ -1161,9 +1164,12 @@ LayerManagerOGL::CreateFBOWithTexture(const nsIntRect& aRect, InitMode aInit,
|
||||
|
||||
// Making this call to fCheckFramebufferStatus prevents a crash on
|
||||
// PowerVR. See bug 695246.
|
||||
if (mGLContext->fCheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER) !=
|
||||
LOCAL_GL_FRAMEBUFFER_COMPLETE) {
|
||||
NS_RUNTIMEABORT("Error setting up framebuffer --- framebuffer not complete");
|
||||
GLenum result = mGLContext->fCheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER);
|
||||
if (result != LOCAL_GL_FRAMEBUFFER_COMPLETE) {
|
||||
nsCAutoString msg;
|
||||
msg.Append("Framebuffer not complete -- error 0x");
|
||||
msg.AppendInt(result, 16);
|
||||
NS_RUNTIMEABORT(msg.get());
|
||||
}
|
||||
|
||||
SetupPipeline(aRect.width, aRect.height, DontApplyWorldTransform);
|
||||
|
@ -187,6 +187,7 @@ function nextTest() {
|
||||
}
|
||||
|
||||
function test() {
|
||||
ignoreAllUncaughtExceptions();
|
||||
nextTest();
|
||||
}
|
||||
|
||||
|
@ -38,17 +38,17 @@ ExecutablePool::~ExecutablePool()
|
||||
}
|
||||
|
||||
void
|
||||
ExecutableAllocator::getCodeStats(size_t& method, size_t& regexp, size_t& unused) const
|
||||
ExecutableAllocator::sizeOfCode(size_t *method, size_t *regexp, size_t *unused) const
|
||||
{
|
||||
method = 0;
|
||||
regexp = 0;
|
||||
unused = 0;
|
||||
*method = 0;
|
||||
*regexp = 0;
|
||||
*unused = 0;
|
||||
|
||||
for (ExecPoolHashSet::Range r = m_pools.all(); !r.empty(); r.popFront()) {
|
||||
ExecutablePool* pool = r.front();
|
||||
method += pool->m_mjitCodeMethod;
|
||||
regexp += pool->m_mjitCodeRegexp;
|
||||
unused += pool->m_allocation.size - pool->m_mjitCodeMethod - pool->m_mjitCodeRegexp;
|
||||
*method += pool->m_mjitCodeMethod;
|
||||
*regexp += pool->m_mjitCodeRegexp;
|
||||
*unused += pool->m_allocation.size - pool->m_mjitCodeMethod - pool->m_mjitCodeRegexp;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -230,7 +230,7 @@ public:
|
||||
m_pools.remove(m_pools.lookup(pool)); // this asserts if |pool| is not in m_pools
|
||||
}
|
||||
|
||||
void getCodeStats(size_t& method, size_t& regexp, size_t& unused) const;
|
||||
void sizeOfCode(size_t *method, size_t *regexp, size_t *unused) const;
|
||||
|
||||
void setDestroyCallback(DestroyCallback destroyCallback) {
|
||||
this->destroyCallback = destroyCallback;
|
||||
|
@ -4564,6 +4564,18 @@ if test -n "$JS_CRASH_DIAGNOSTICS"; then
|
||||
AC_DEFINE(JS_CRASH_DIAGNOSTICS)
|
||||
fi
|
||||
|
||||
dnl ========================================================
|
||||
dnl Enable changes that make the shell more deterministic
|
||||
dnl ========================================================
|
||||
MOZ_ARG_ENABLE_BOOL(more-deterministic,
|
||||
[ --enable-more-deterministic
|
||||
Enable changes that make the shell more deterministic],
|
||||
JS_MORE_DETERMINISTIC=1,
|
||||
JS_MORE_DETERMINISTIC= )
|
||||
if test -n "$JS_MORE_DETERMINISTIC"; then
|
||||
AC_DEFINE(JS_MORE_DETERMINISTIC)
|
||||
fi
|
||||
|
||||
dnl ======================================================
|
||||
dnl = Enable compiling with ccache
|
||||
dnl ======================================================
|
||||
|
@ -140,11 +140,10 @@ LifoAlloc::freeUnused()
|
||||
}
|
||||
|
||||
/* Free all chunks after |latest|. */
|
||||
size_t freed = 0;
|
||||
for (BumpChunk *victim = latest->next(); victim; victim = victim->next()) {
|
||||
for (BumpChunk *victim = latest->next(); victim; victim = victim->next())
|
||||
BumpChunk::delete_(victim);
|
||||
freed++;
|
||||
}
|
||||
|
||||
latest->setNext(NULL);
|
||||
}
|
||||
|
||||
LifoAlloc::BumpChunk *
|
||||
|
@ -325,7 +325,8 @@ class LifoAlloc
|
||||
void *reallocUnaligned(void *origPtr, size_t origSize, size_t incr);
|
||||
};
|
||||
|
||||
class LifoAllocScope {
|
||||
class LifoAllocScope
|
||||
{
|
||||
LifoAlloc *lifoAlloc;
|
||||
void *mark;
|
||||
bool shouldRelease;
|
||||
|
@ -126,7 +126,6 @@ BytecodeEmitter::BytecodeEmitter(Parser *parser, uintN lineno)
|
||||
globalMap(parser->context),
|
||||
closedArgs(parser->context),
|
||||
closedVars(parser->context),
|
||||
traceIndex(0),
|
||||
typesetCount(0)
|
||||
{
|
||||
flags = TCF_COMPILING;
|
||||
@ -1450,7 +1449,7 @@ EmitTraceOp(JSContext *cx, BytecodeEmitter *bce, ParseNode *nextpn)
|
||||
{
|
||||
if (nextpn) {
|
||||
/*
|
||||
* Try to give the JSOP_TRACE the same line number as the next
|
||||
* Try to give the JSOP_LOOPHEAD the same line number as the next
|
||||
* instruction. nextpn is often a block, in which case the next
|
||||
* instruction typically comes from the first statement inside.
|
||||
*/
|
||||
@ -1461,10 +1460,7 @@ EmitTraceOp(JSContext *cx, BytecodeEmitter *bce, ParseNode *nextpn)
|
||||
return -1;
|
||||
}
|
||||
|
||||
uint32 index = bce->traceIndex;
|
||||
if (index < UINT16_MAX)
|
||||
bce->traceIndex++;
|
||||
return Emit3(cx, bce, JSOP_TRACE, UINT16_HI(index), UINT16_LO(index));
|
||||
return Emit1(cx, bce, JSOP_LOOPHEAD);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -5510,7 +5506,7 @@ EmitForIn(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn, ptrdiff_t top)
|
||||
if (jmp < 0)
|
||||
return false;
|
||||
|
||||
intN noteIndex2 = NewSrcNote(cx, bce, SRC_TRACE);
|
||||
intN noteIndex2 = NewSrcNote(cx, bce, SRC_LOOPHEAD);
|
||||
if (noteIndex2 < 0)
|
||||
return false;
|
||||
|
||||
@ -5651,7 +5647,7 @@ EmitNormalFor(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn, ptrdiff_t top)
|
||||
top = bce->offset();
|
||||
SET_STATEMENT_TOP(&stmtInfo, top);
|
||||
|
||||
intN noteIndex2 = NewSrcNote(cx, bce, SRC_TRACE);
|
||||
intN noteIndex2 = NewSrcNote(cx, bce, SRC_LOOPHEAD);
|
||||
if (noteIndex2 < 0)
|
||||
return false;
|
||||
|
||||
@ -5975,7 +5971,7 @@ frontend::EmitTree(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn)
|
||||
jmp = EmitJump(cx, bce, JSOP_GOTO, 0);
|
||||
if (jmp < 0)
|
||||
return JS_FALSE;
|
||||
noteIndex2 = NewSrcNote(cx, bce, SRC_TRACE);
|
||||
noteIndex2 = NewSrcNote(cx, bce, SRC_LOOPHEAD);
|
||||
if (noteIndex2 < 0)
|
||||
return JS_FALSE;
|
||||
top = EmitTraceOp(cx, bce, pn->pn_right);
|
||||
@ -6006,7 +6002,7 @@ frontend::EmitTree(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn)
|
||||
if (noteIndex < 0 || Emit1(cx, bce, JSOP_NOP) < 0)
|
||||
return JS_FALSE;
|
||||
|
||||
noteIndex2 = NewSrcNote(cx, bce, SRC_TRACE);
|
||||
noteIndex2 = NewSrcNote(cx, bce, SRC_LOOPHEAD);
|
||||
if (noteIndex2 < 0)
|
||||
return JS_FALSE;
|
||||
|
||||
|
@ -674,7 +674,6 @@ struct BytecodeEmitter : public TreeContext
|
||||
SlotVector closedArgs;
|
||||
SlotVector closedVars;
|
||||
|
||||
uint16 traceIndex; /* index for the next JSOP_TRACE instruction */
|
||||
uint16 typesetCount; /* Number of JOF_TYPESET opcodes generated */
|
||||
|
||||
BytecodeEmitter(Parser *parser, uintN lineno);
|
||||
@ -957,7 +956,7 @@ enum SrcNoteType {
|
||||
SRC_WHILE = 4, /* JSOP_GOTO to for or while loop condition
|
||||
from before loop, else JSOP_NOP at top of
|
||||
do-while loop */
|
||||
SRC_TRACE = 4, /* For JSOP_TRACE; includes distance to loop end */
|
||||
SRC_LOOPHEAD = 4, /* For JSOP_LOOPHEAD; includes distance to loop end */
|
||||
SRC_CONTINUE = 5, /* JSOP_GOTO is a continue, not a break;
|
||||
also used on JSOP_ENDINIT if extra comma
|
||||
at end of array literal: [1,2,,];
|
||||
|
@ -20,14 +20,14 @@ f3()
|
||||
|
||||
// bug 657984 #2
|
||||
function f4(){ for(y in x); }
|
||||
trap(f4, 10, '')
|
||||
trap(f4, 8, '')
|
||||
f4()
|
||||
|
||||
// bug 658464
|
||||
function f5() {
|
||||
for ([, x] in 0) {}
|
||||
}
|
||||
trap(f5, 9, '')
|
||||
trap(f5, 7, '')
|
||||
f5()
|
||||
|
||||
// bug 658465
|
||||
@ -60,7 +60,7 @@ f9 = (function() {
|
||||
for each(let w in []) {}
|
||||
}
|
||||
})
|
||||
trap(f9, 27, undefined);
|
||||
trap(f9, 22, undefined);
|
||||
for (b in f9())
|
||||
(function() {})()
|
||||
|
||||
@ -75,5 +75,5 @@ try { f10() } catch (e) {}
|
||||
|
||||
// bug 659337
|
||||
f11 = Function("for (x = 0; x < 6; x++) { gc() }");
|
||||
trap(f11, 25, '');
|
||||
trap(f11, 23, '');
|
||||
f11()
|
||||
|
13
js/src/jit-test/tests/basic/bug685321-2.js
Normal file
13
js/src/jit-test/tests/basic/bug685321-2.js
Normal file
@ -0,0 +1,13 @@
|
||||
var o = {};
|
||||
function f() {
|
||||
function g() {
|
||||
x = 80;
|
||||
return x;
|
||||
};
|
||||
Object.defineProperty(o, "f", {get:g});
|
||||
var [x] = 0;
|
||||
x = {};
|
||||
2 + o.f;
|
||||
print(x);
|
||||
}
|
||||
f();
|
@ -11,5 +11,5 @@ f = (function() {
|
||||
} catch (e) {}
|
||||
}
|
||||
})
|
||||
trap(f, 54, undefined);
|
||||
trap(f, 52, undefined);
|
||||
f()
|
||||
|
@ -93,9 +93,6 @@ ScriptAnalysis::addJump(JSContext *cx, unsigned offset,
|
||||
jsbytecode *pc = script->code + offset;
|
||||
UntrapOpcode untrap(cx, script, pc);
|
||||
|
||||
if (JSOp(*pc) == JSOP_TRACE || JSOp(*pc) == JSOP_NOTRACE)
|
||||
code->loopHead = true;
|
||||
|
||||
/* Scripts containing loops are never inlined. */
|
||||
isInlineable = false;
|
||||
|
||||
@ -669,7 +666,7 @@ ScriptAnalysis::analyzeLifetimes(JSContext *cx)
|
||||
|
||||
JSOp op = (JSOp) *pc;
|
||||
|
||||
if ((op == JSOP_TRACE || op == JSOP_NOTRACE) && code->loop) {
|
||||
if (op == JSOP_LOOPHEAD && code->loop) {
|
||||
/*
|
||||
* This is the head of a loop, we need to go and make sure that any
|
||||
* variables live at the head are live at the backedge and points prior.
|
||||
@ -816,7 +813,7 @@ ScriptAnalysis::analyzeLifetimes(JSContext *cx)
|
||||
|
||||
#ifdef DEBUG
|
||||
JSOp nop = JSOp(script->code[targetOffset]);
|
||||
JS_ASSERT(nop == JSOP_TRACE || nop == JSOP_NOTRACE || nop == JSOP_TRAP);
|
||||
JS_ASSERT(nop == JSOP_LOOPHEAD || nop == JSOP_TRAP);
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -1173,7 +1170,7 @@ ScriptAnalysis::analyzeSSA(JSContext *cx)
|
||||
PodZero(stack + stackDepth, code->stackDepth - stackDepth);
|
||||
stackDepth = code->stackDepth;
|
||||
|
||||
if ((op == JSOP_TRACE || op == JSOP_NOTRACE) && code->loop) {
|
||||
if (op == JSOP_LOOPHEAD && code->loop) {
|
||||
/*
|
||||
* Make sure there is a pending value array for phi nodes at the
|
||||
* loop head. We won't be able to clear these until we reach the
|
||||
|
@ -98,9 +98,6 @@ class Bytecode
|
||||
/* Whether there are any incoming jumps to this instruction. */
|
||||
bool jumpTarget : 1;
|
||||
|
||||
/* There is a backwards jump to this instruction. */
|
||||
bool loopHead : 1;
|
||||
|
||||
/* Whether there is fallthrough to this instruction from a non-branching instruction. */
|
||||
bool fallthrough : 1;
|
||||
|
||||
|
@ -1144,6 +1144,12 @@ JS_ContextIterator(JSRuntime *rt, JSContext **iterp)
|
||||
return js_ContextIterator(rt, JS_TRUE, iterp);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(JSContext *)
|
||||
JS_ContextIteratorUnlocked(JSRuntime *rt, JSContext **iterp)
|
||||
{
|
||||
return js_ContextIterator(rt, JS_FALSE, iterp);
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(JSVersion)
|
||||
JS_GetVersion(JSContext *cx)
|
||||
{
|
||||
|
@ -2101,6 +2101,9 @@ JS_GetRuntime(JSContext *cx);
|
||||
extern JS_PUBLIC_API(JSContext *)
|
||||
JS_ContextIterator(JSRuntime *rt, JSContext **iterp);
|
||||
|
||||
extern JS_PUBLIC_API(JSContext *)
|
||||
JS_ContextIteratorUnlocked(JSRuntime *rt, JSContext **iterp);
|
||||
|
||||
extern JS_PUBLIC_API(JSVersion)
|
||||
JS_GetVersion(JSContext *cx);
|
||||
|
||||
|
@ -137,6 +137,35 @@ ThreadData::init()
|
||||
return stackSpace.init() && !!(dtoaState = js_NewDtoaState());
|
||||
}
|
||||
|
||||
#ifdef JS_THREADSAFE
|
||||
void
|
||||
ThreadData::sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf, size_t *normal, size_t *temporary,
|
||||
size_t *regexpCode, size_t *stackCommitted)
|
||||
{
|
||||
/*
|
||||
* There are other ThreadData members that could be measured; the ones
|
||||
* below have been seen by DMD to be worth measuring. More stuff may be
|
||||
* added later.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The computedSize is 0 because sizeof(DtoaState) isn't available here and
|
||||
* it's not worth making it available.
|
||||
*/
|
||||
*normal = mallocSizeOf(dtoaState, /* sizeof(DtoaState) */0);
|
||||
|
||||
*temporary = tempLifoAlloc.sizeOfExcludingThis(mallocSizeOf);
|
||||
|
||||
size_t method = 0, regexp = 0, unused = 0;
|
||||
if (execAlloc)
|
||||
execAlloc->sizeOfCode(&method, ®exp, &unused);
|
||||
JS_ASSERT(method == 0); /* this execAlloc is only used for regexp code */
|
||||
*regexpCode = regexp + unused;
|
||||
|
||||
*stackCommitted = stackSpace.sizeOfCommitted();
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
ThreadData::triggerOperationCallback(JSRuntime *rt)
|
||||
{
|
||||
@ -219,6 +248,14 @@ js_GetCurrentScript(JSContext *cx)
|
||||
|
||||
#ifdef JS_THREADSAFE
|
||||
|
||||
void
|
||||
JSThread::sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf, size_t *normal, size_t *temporary,
|
||||
size_t *regexpCode, size_t *stackCommitted)
|
||||
{
|
||||
data.sizeOfExcludingThis(mallocSizeOf, normal, temporary, regexpCode, stackCommitted);
|
||||
*normal += mallocSizeOf(this, sizeof(JSThread));
|
||||
}
|
||||
|
||||
JSThread *
|
||||
js_CurrentThreadAndLockGC(JSRuntime *rt)
|
||||
{
|
||||
@ -775,6 +812,17 @@ js_ReportOutOfMemory(JSContext *cx)
|
||||
JS_FRIEND_API(void)
|
||||
js_ReportOverRecursed(JSContext *maybecx)
|
||||
{
|
||||
#ifdef JS_MORE_DETERMINISTIC
|
||||
/*
|
||||
* We cannot make stack depth deterministic across different
|
||||
* implementations (e.g. JIT vs. interpreter will differ in
|
||||
* their maximum stack depth).
|
||||
* However, we can detect externally when we hit the maximum
|
||||
* stack depth which is useful for external testing programs
|
||||
* like fuzzers.
|
||||
*/
|
||||
fprintf(stderr, "js_ReportOverRecursed called\n");
|
||||
#endif
|
||||
if (maybecx)
|
||||
JS_ReportErrorNumber(maybecx, js_GetErrorMessage, NULL, JSMSG_OVER_RECURSED);
|
||||
}
|
||||
@ -1655,6 +1703,18 @@ JSContext::updateJITEnabled()
|
||||
#endif
|
||||
}
|
||||
|
||||
size_t
|
||||
JSContext::sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf) const
|
||||
{
|
||||
/*
|
||||
* There are other JSContext members that could be measured; the following
|
||||
* ones have been found by DMD to be worth measuring. More stuff may be
|
||||
* added later.
|
||||
*/
|
||||
return mallocSizeOf(this, sizeof(JSContext)) +
|
||||
busyArrays.sizeOfExcludingThis(mallocSizeOf);
|
||||
}
|
||||
|
||||
namespace js {
|
||||
|
||||
AutoEnumStateRooter::~AutoEnumStateRooter()
|
||||
|
@ -227,6 +227,11 @@ struct ThreadData {
|
||||
propertyCache.purge(cx);
|
||||
}
|
||||
|
||||
#ifdef JS_THREADSAFE
|
||||
void sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf, size_t *normal, size_t *temporary,
|
||||
size_t *regexpCode, size_t *stackCommitted);
|
||||
#endif
|
||||
|
||||
/* This must be called with the GC lock held. */
|
||||
void triggerOperationCallback(JSRuntime *rt);
|
||||
|
||||
@ -257,7 +262,7 @@ struct JSThread {
|
||||
/* Opaque thread-id, from NSPR's PR_GetCurrentThread(). */
|
||||
void *id;
|
||||
|
||||
/* Number of JS_SuspendRequest calls withot JS_ResumeRequest. */
|
||||
/* Number of JS_SuspendRequest calls without JS_ResumeRequest. */
|
||||
unsigned suspendCount;
|
||||
|
||||
# ifdef DEBUG
|
||||
@ -286,6 +291,10 @@ struct JSThread {
|
||||
bool init() {
|
||||
return data.init();
|
||||
}
|
||||
|
||||
JS_FRIEND_API(void) sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf, size_t *normal,
|
||||
size_t *temporary, size_t *regexpCode,
|
||||
size_t *stackCommitted);
|
||||
};
|
||||
|
||||
#define JS_THREAD_DATA(cx) (&(cx)->thread()->data)
|
||||
@ -1269,6 +1278,8 @@ struct JSContext
|
||||
*/
|
||||
bool runningWithTrustedPrincipals() const;
|
||||
|
||||
JS_FRIEND_API(size_t) sizeOfIncludingThis(JSMallocSizeOfFun mallocSizeOf) const;
|
||||
|
||||
static inline JSContext *fromLinkField(JSCList *link) {
|
||||
JS_ASSERT(link);
|
||||
return reinterpret_cast<JSContext *>(uintptr_t(link) - offsetof(JSContext, link));
|
||||
|
@ -49,7 +49,6 @@
|
||||
#include "jswatchpoint.h"
|
||||
#include "jswrapper.h"
|
||||
#include "assembler/wtf/Platform.h"
|
||||
#include "assembler/jit/ExecutableAllocator.h"
|
||||
#include "yarr/BumpPointerAllocator.h"
|
||||
#include "methodjit/MethodJIT.h"
|
||||
#include "methodjit/PolyIC.h"
|
||||
@ -150,14 +149,14 @@ JSCompartment::ensureJaegerCompartmentExists(JSContext *cx)
|
||||
}
|
||||
|
||||
void
|
||||
JSCompartment::getMjitCodeStats(size_t& method, size_t& regexp, size_t& unused) const
|
||||
JSCompartment::sizeOfCode(size_t *method, size_t *regexp, size_t *unused) const
|
||||
{
|
||||
if (jaegerCompartment_) {
|
||||
jaegerCompartment_->execAlloc()->getCodeStats(method, regexp, unused);
|
||||
jaegerCompartment_->execAlloc()->sizeOfCode(method, regexp, unused);
|
||||
} else {
|
||||
method = 0;
|
||||
regexp = 0;
|
||||
unused = 0;
|
||||
*method = 0;
|
||||
*regexp = 0;
|
||||
*unused = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -232,7 +232,7 @@ struct JS_FRIEND_API(JSCompartment) {
|
||||
|
||||
bool ensureJaegerCompartmentExists(JSContext *cx);
|
||||
|
||||
void getMjitCodeStats(size_t& method, size_t& regexp, size_t& unused) const;
|
||||
void sizeOfCode(size_t *method, size_t *regexp, size_t *unused) const;
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user