Merge last PGO-green changeset of mozilla-inbound to mozilla-central

This commit is contained in:
Ed Morley 2012-10-11 14:46:06 +01:00
commit 6b8eb9be1b
343 changed files with 3599 additions and 2905 deletions

View File

@ -196,7 +196,7 @@ LogDocParent(nsIDocument* aDocumentNode)
static void
LogDocInfo(nsIDocument* aDocumentNode, DocAccessible* aDocument)
{
printf(" DOM id: %p, acc id: %p\n ",
printf(" DOM document: %p, acc document: %p\n ",
static_cast<void*>(aDocumentNode), static_cast<void*>(aDocument));
// log document info
@ -322,6 +322,20 @@ LogRequest(nsIRequest* aRequest)
}
}
static void
LogDocAccState(DocAccessible* aDocument)
{
printf("document acc state: ");
if (aDocument->HasLoadState(DocAccessible::eCompletelyLoaded))
printf("completely loaded;");
else if (aDocument->HasLoadState(DocAccessible::eReady))
printf("ready;");
else if (aDocument->HasLoadState(DocAccessible::eDOMLoaded))
printf("DOM loaded;");
else if (aDocument->HasLoadState(DocAccessible::eTreeConstructed))
printf("tree constructed;");
}
static void
GetDocLoadEventType(AccEvent* aEvent, nsACString& aEventType)
{
@ -406,6 +420,30 @@ logging::DocLoad(const char* aMsg, nsIDocument* aDocumentNode)
MsgEnd();
}
void
logging::DocCompleteLoad(DocAccessible* aDocument, bool aIsLoadEventTarget)
{
MsgBegin(sDocLoadTitle, "document loaded *completely*");
nsIDocument* docNode = aDocument->GetDocumentNode();
printf(" DOM document: %p, acc document: %p\n",
static_cast<void*>(aDocument->GetDocumentNode()),
static_cast<void*>(aDocument));
printf(" ");
LogDocURI(aDocument->GetDocumentNode());
printf("\n");
printf(" ");
LogDocAccState(aDocument);
printf("\n");
printf(" document is load event target: %s\n",
(aIsLoadEventTarget ? "true" : "false"));
MsgEnd();
}
void
logging::DocLoadEventFired(AccEvent* aEvent)
{

View File

@ -56,6 +56,7 @@ bool IsEnabled(uint32_t aModules);
void DocLoad(const char* aMsg, nsIWebProgress* aWebProgress,
nsIRequest* aRequest, uint32_t aStateFlags);
void DocLoad(const char* aMsg, nsIDocument* aDocumentNode);
void DocCompleteLoad(DocAccessible* aDocument, bool aIsLoadEventTarget);
/**
* Log that document load event was fired.

View File

@ -1469,6 +1469,14 @@ DocAccessible::ContentRemoved(nsIContent* aContainerNode,
void
DocAccessible::RecreateAccessible(nsIContent* aContent)
{
#ifdef A11Y_LOG
if (logging::IsEnabled(logging::eTree)) {
logging::MsgBegin("TREE", "accessible recreated");
logging::Node("content", aContent);
logging::MsgEnd();
}
#endif
// XXX: we shouldn't recreate whole accessible subtree, instead we should
// subclass hide and show events to handle them separately and implement their
// coalescence with normal hide and show events. Note, in this case they
@ -1579,6 +1587,11 @@ DocAccessible::ProcessLoad()
{
mLoadState |= eCompletelyLoaded;
#ifdef A11Y_LOG
if (logging::IsEnabled(logging::eDocLoad))
logging::DocCompleteLoad(this, IsLoadEventTarget());
#endif
// Do not fire document complete/stop events for root chrome document
// accessibles and for frame/iframe documents because
// a) screen readers start working on focus event in the case of root chrome
@ -2064,25 +2077,31 @@ bool
DocAccessible::IsLoadEventTarget() const
{
nsCOMPtr<nsISupports> container = mDocument->GetContainer();
nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem =
do_QueryInterface(container);
NS_ASSERTION(docShellTreeItem, "No document shell for document!");
nsCOMPtr<nsIDocShellTreeItem> treeItem = do_QueryInterface(container);
NS_ASSERTION(treeItem, "No document shell for document!");
nsCOMPtr<nsIDocShellTreeItem> parentTreeItem;
docShellTreeItem->GetParent(getter_AddRefs(parentTreeItem));
treeItem->GetParent(getter_AddRefs(parentTreeItem));
// Return true if it's not a root document (either tab document or
// frame/iframe document) and its parent document is not in loading state.
// Note: we can get notifications while document is loading (and thus
// while there's no parent document yet).
// Not a root document.
if (parentTreeItem) {
// Return true if it's either:
// a) tab document;
nsCOMPtr<nsIDocShellTreeItem> rootTreeItem;
treeItem->GetRootTreeItem(getter_AddRefs(rootTreeItem));
if (parentTreeItem == rootTreeItem)
return true;
// b) frame/iframe document and its parent document is not in loading state
// Note: we can get notifications while document is loading (and thus
// while there's no parent document yet).
DocAccessible* parentDoc = ParentDocument();
return parentDoc && parentDoc->HasLoadState(eCompletelyLoaded);
}
// It's content (not chrome) root document.
int32_t contentType;
docShellTreeItem->GetItemType(&contentType);
treeItem->GetItemType(&contentType);
return (contentType == nsIDocShellTreeItem::typeContent);
}

View File

@ -54,12 +54,12 @@ var Utils = {
get AndroidSdkVersion() {
if (!this._AndroidSdkVersion) {
let shellVersion = Services.sysinfo.get('shellVersion') || '';
let matches = shellVersion.match(/\((\d+)\)$/);
if (matches)
this._AndroidSdkVersion = parseInt(matches[1]);
else
this._AndroidSdkVersion = 15; // Most useful in desktop debugging.
if (Services.appinfo.OS == 'Android') {
this._AndroidSdkVersion = Services.sysinfo.getPropertyAsInt32('version');
} else {
// Most useful in desktop debugging.
this._AndroidSdkVersion = 15;
}
}
return this._AndroidSdkVersion;
},

View File

@ -271,7 +271,7 @@ nsXFormsEditableAccessible::GetEditor() const
nsXFormsSelectableAccessible::
nsXFormsSelectableAccessible(nsIContent* aContent, DocAccessible* aDoc) :
nsXFormsEditableAccessible(aContent, aDoc), mIsSelect1Element(nullptr)
nsXFormsEditableAccessible(aContent, aDoc), mIsSelect1Element(false)
{
mIsSelect1Element =
mContent->NodeInfo()->Equals(nsGkAtoms::select1);

View File

@ -621,6 +621,7 @@ function prettyName(aIdentifier)
return " '" + aIdentifier + "' ";
}
////////////////////////////////////////////////////////////////////////////////
// Private
////////////////////////////////////////////////////////////////////////////////

View File

@ -98,13 +98,23 @@ function waitForEvent(aEventType, aTarget, aFunc, aContext, aArg1, aArg2)
registerA11yEventListener(aEventType, handler);
}
/**
* Generate mouse move over image map what creates image map accessible (async).
* See waitForImageMap() function.
*/
function waveOverImageMap(aImageMapID)
{
var imageMapNode = getNode(aImageMapID);
synthesizeMouse(imageMapNode, 10, 10, { type: "mousemove" },
imageMapNode.ownerDocument.defaultView);
}
/**
* Call the given function when the tree of the given image map is built.
*/
function waitForImageMap(aImageMapID, aTestFunc)
{
synthesizeMouse(aImageMapID, 10, 10, { type: "mousemove" },
aImageMapID.ownerDocument.defaultView);
waveOverImageMap(aImageMapID);
var imageMapAcc = getAccessible(aImageMapID);
if (imageMapAcc.firstChild)

View File

@ -19,8 +19,7 @@
<script type="application/javascript">
function doPreTest()
{
var imgMap = document.getElementById("imgmap");
waitForImageMap(imgMap, doTest);
waitForImageMap("imgmap", doTest);
}
function doTest()

View File

@ -60,8 +60,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=418368
//gA11yEventDumpToConsole = true; // debug stuff
function doPreTest()
{
var imgMap = document.getElementById("imgmap");
waitForImageMap(imgMap, doTest);
waitForImageMap("imgmap", doTest);
}
var gQueue = null;

View File

@ -44,8 +44,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=428248
//gA11yEventDumpToConsole = true;
function doPreTest()
{
var imgMap = document.getElementById("imgmap");
waitForImageMap(imgMap, doTest);
waitForImageMap("imgmap", doTest);
}
function doTest()

View File

@ -22,8 +22,7 @@
//gA11yEventDumpToConsole = true;
function doPreTest()
{
var imgMap = document.getElementById("imagemap");
waitForImageMap(imgMap, doTest);
waitForImageMap("imagemap", doTest);
}
function doTest()

View File

@ -21,7 +21,7 @@
src="../events.js"></script>
<script type="application/javascript">
gA11yEventDumpToConsole = true; // debug stuff
//gA11yEventDumpToConsole = true; // debug stuff
function doTest()
{
@ -50,7 +50,7 @@
// a: traversal state
testStates("link_traversed", 0, 0, STATE_TRAVERSED);
enableLogging("docload");
//enableLogging("docload"); // debug stuff
registerA11yEventListener(EVENT_DOCUMENT_LOAD_COMPLETE,
traversedLinkTester);
@ -64,7 +64,7 @@
aEvent.accessible.rootDocument.window.close();
testStates("link_traversed", STATE_TRAVERSED);
disableLogging();
//disableLogging();
SimpleTest.finish();
}
};

View File

@ -20,8 +20,6 @@
<![CDATA[
function doTest()
{
disableLogging(); // a hack from failing test_link.html to stop logging.
// label with popup
testStates("labelWithPopup", STATE_HASPOPUP);

View File

@ -22,8 +22,7 @@
//gA11yEventDumpToConsole = true;
function doPreTest()
{
var imgMap = document.getElementById("imagemap");
waitForImageMap(imgMap, doTest);
waitForImageMap("imagemap", doTest);
}
function doTest()

View File

@ -21,8 +21,7 @@
//gA11yEventDumpToConsole = true;
function doPreTest()
{
var imgMap = document.getElementById("imgmap");
waitForImageMap(imgMap, doTest);
waitForImageMap("imgmap", doTest);
}
function doTest()

View File

@ -20,7 +20,7 @@ MOCHITEST_A11Y_FILES =\
test_doc.html \
test_gencontent.html \
test_hidden.html \
$(warning test_imagemap.html temporarily disabled because of very frequent oranges, see bug 745788) \
test_imagemap.html \
test_list_editabledoc.html \
test_list.html \
test_listbox.xul \

View File

@ -228,6 +228,9 @@
{
this.imageMap = getAccessible(aImageMapID);
this.mapNode.setAttribute("name", "atoz_map");
// XXXhack: force repainting of the image (see bug 745788 for details).
waveOverImageMap(aImageMapID);
}
this.finalCheck = function removeNameOnMap_finalCheck()
@ -324,10 +327,6 @@
map.appendChild(area);
this.containerNode.appendChild(map);
// force repainting of the image
// XXX this is a hack. Fix bug 745788.
document.getElementById(aImageID).style.opacity = 0.8;
}
this.finalCheck = function insertMap_finalCheck()
@ -382,11 +381,10 @@
}
}
gA11yEventDumpToConsole = true;
//gA11yEventDumpToConsole = true; // debug stuff
function doPreTest()
{
var imgMap = document.getElementById("imgmap");
waitForImageMap(imgMap, doTest);
waitForImageMap("imgmap", doTest);
}
var gQueue = null;
@ -403,6 +401,9 @@
gQueue.push(new insertMap("container", "imgmap"));
gQueue.push(new hideImageMap("container", "imgmap"));
//enableLogging("tree"); // debug stuff
//gQueue.onFinish = function() { disableLogging("tree"); }
gQueue.invoke(); // Will call SimpleTest.finish();
}

View File

@ -1,6 +1,6 @@
[
{
"clang_version": "r163716"
"clang_version": "r164411"
},
{
"size": 47,
@ -9,8 +9,8 @@
"filename": "setup.sh"
},
{
"size": 54033946,
"digest": "50eb6fa636403f444bab10aee2370f1ac624a1e0105566639c7c266e784dbc6e4cd3901bbd11f53c4c63b2a6d2d07a603b3d9c333f5049bdc7a816b7d225631b",
"size": 54336567,
"digest": "f692fb99c0faae0e850d0fba1ea1905064c00b7c65c03367369fec685771511c4e97445139be8eaa1bb6380055594cebef1e23cc0fd0717203411cd8082f37fa",
"algorithm": "sha512",
"filename": "clang.tar.bz2"
}

View File

@ -221,10 +221,7 @@ pref("general.autoScroll", false);
pref("general.autoScroll", true);
#endif
// Send aol.com the legacy build date instead of the version number in the UA's
// Gecko token as a temporary measure against bug 778408 (mail.aol.com defaults
// to basic web UI when accessed with a user agent without Gecko/20100101).
pref("general.useragent.override.aol.com", "Gecko/[^ ]*#Gecko/20100101");
pref("general.useragent.complexOverride.moodle", true); // bug 797703
// At startup, check if we're the default browser and prompt user if not.
pref("browser.shell.checkDefaultBrowser", true);

View File

@ -27,6 +27,12 @@
label="&newNavigatorCmd.label;"
command="cmd_newNavigator"
key="key_newNavigator"/>
#ifdef MOZ_PER_WINDOW_PRIVATE_BROWSING
<menuitem id="appmenu_newPrivateWindow"
label="&newPrivateWindow.label;"
command="Tools:PrivateBrowsing"
key="key_privatebrowsing"/>
#endif
<menuseparator/>
<menuitem id="appmenu_openFile"
label="&openFileCmd.label;"
@ -34,6 +40,7 @@
key="openFileKb"/>
</menupopup>
</splitmenu>
#ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING
<menuitem id="appmenu_privateBrowsing"
class="menuitem-iconic menuitem-iconic-tooltip"
label="&privateBrowsingCmd.start.label;"
@ -41,6 +48,7 @@
stoplabel="&privateBrowsingCmd.stop.label;"
command="Tools:PrivateBrowsing"
key="key_privatebrowsing"/>
#endif
<menuitem label="&goOfflineCmd.label;"
id="appmenu_offlineModeRecovery"
type="checkbox"

View File

@ -22,6 +22,13 @@
accesskey="&newNavigatorCmd.accesskey;"
key="key_newNavigator"
command="cmd_newNavigator"/>
#ifdef MOZ_PER_WINDOW_PRIVATE_BROWSING
<menuitem id="menu_newPrivateWindow"
label="&newPrivateWindow.label;"
accesskey="&newPrivateWindow.accesskey;"
command="Tools:PrivateBrowsing"
key="key_privatebrowsing"/>
#endif
<menuitem id="menu_openLocation"
class="show-only-for-keyboard"
label="&openLocationCmd.label;"
@ -541,6 +548,7 @@
#endif
command="View:PageInfo"/>
<menuseparator id="sanitizeSeparator"/>
#ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING
<menuitem id="privateBrowsingItem"
label="&privateBrowsingCmd.start.label;"
accesskey="&privateBrowsingCmd.start.accesskey;"
@ -550,6 +558,7 @@
stopaccesskey="&privateBrowsingCmd.stop.accesskey;"
key="key_privatebrowsing"
command="Tools:PrivateBrowsing"/>
#endif
<menuitem id="sanitizeItem"
accesskey="&clearRecentHistory.accesskey;"
label="&clearRecentHistory.label;"

View File

@ -262,14 +262,14 @@ var gPluginHandler = {
// Callback for user clicking on a missing (unsupported) plugin.
installSinglePlugin: function (plugin) {
var missingPluginsArray = {};
var missingPlugins = new Map();
var pluginInfo = getPluginInfo(plugin);
missingPluginsArray[pluginInfo.mimetype] = pluginInfo;
missingPlugins.set(pluginInfo.mimetype, pluginInfo);
openDialog("chrome://mozapps/content/plugins/pluginInstallerWizard.xul",
"PFSWindow", "chrome,centerscreen,resizable=yes",
{plugins: missingPluginsArray, browser: gBrowser.selectedBrowser});
{plugins: missingPlugins, browser: gBrowser.selectedBrowser});
},
// Callback for user clicking on a disabled plugin
@ -423,19 +423,20 @@ var gPluginHandler = {
let contentWindow = aBrowser.contentWindow;
let cwu = contentWindow.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindowUtils);
let pluginsDictionary = {};
let pluginsDictionary = new Map();
for (let plugin of cwu.plugins) {
let objLoadingContent = plugin.QueryInterface(Ci.nsIObjectLoadingContent);
if (gPluginHandler.canActivatePlugin(objLoadingContent)) {
let pluginName = getPluginInfo(plugin).pluginName;
if (!pluginsDictionary[pluginName]) pluginsDictionary[pluginName] = [];
pluginsDictionary[pluginName].push(objLoadingContent);
if (!pluginsDictionary.has(pluginName))
pluginsDictionary.set(pluginName, []);
pluginsDictionary.get(pluginName).push(objLoadingContent);
}
}
let centerActions = [];
for (let pluginName in pluginsDictionary) {
let plugin = pluginsDictionary[pluginName][0];
for (let [pluginName, namedPluginArray] of pluginsDictionary) {
let plugin = namedPluginArray[0];
let warn = false;
let warningText = "";
let updateLink = Services.urlFormatter.formatURLPref("plugins.update.url");
@ -539,10 +540,10 @@ var gPluginHandler = {
let browser = gBrowser.getBrowserForDocument(plugin.ownerDocument
.defaultView.top.document);
if (!browser.missingPlugins)
browser.missingPlugins = {};
browser.missingPlugins = new Map();
var pluginInfo = getPluginInfo(plugin);
browser.missingPlugins[pluginInfo.mimetype] = pluginInfo;
browser.missingPlugins.set(pluginInfo.mimetype, pluginInfo);
var notificationBox = gBrowser.getNotificationBox(browser);
@ -568,11 +569,11 @@ var gPluginHandler = {
function showPluginsMissing() {
// get the urls of missing plugins
var missingPluginsArray = gBrowser.selectedBrowser.missingPlugins;
if (missingPluginsArray) {
var missingPlugins = gBrowser.selectedBrowser.missingPlugins;
if (missingPlugins) {
openDialog("chrome://mozapps/content/plugins/pluginInstallerWizard.xul",
"PFSWindow", "chrome,centerscreen,resizable=yes",
{plugins: missingPluginsArray, browser: gBrowser.selectedBrowser});
{plugins: missingPlugins, browser: gBrowser.selectedBrowser});
}
}

View File

@ -102,7 +102,12 @@
<command id="Tools:ErrorConsole" oncommand="toJavaScriptConsole()" hidden="true"/>
<command id="Tools:Sanitize"
oncommand="Cc['@mozilla.org/browser/browserglue;1'].getService(Ci.nsIBrowserGlue).sanitize(window);"/>
<command id="Tools:PrivateBrowsing" oncommand="gPrivateBrowsingUI.toggleMode();"/>
<command id="Tools:PrivateBrowsing"
#ifdef MOZ_PER_WINDOW_PRIVATE_BROWSING
oncommand="OpenBrowserWindow({private: true});"/>
#else
oncommand="gPrivateBrowsingUI.toggleMode();"/>
#endif
<command id="History:UndoCloseTab" oncommand="undoCloseTab();"/>
<command id="History:UndoCloseWindow" oncommand="undoCloseWindow();"/>
<command id="Browser:ToggleAddonBar" oncommand="toggleAddonBar();"/>

View File

@ -623,7 +623,7 @@ var SocialToolbar = {
if (profile.userName) {
notLoggedInLabel.hidden = true;
userNameBtn.hidden = false;
userNameBtn.label = profile.userName;
userNameBtn.value = profile.userName;
} else {
notLoggedInLabel.hidden = false;
userNameBtn.hidden = true;

View File

@ -1563,7 +1563,9 @@ var gBrowserInit = {
PlacesStarButton.uninit();
#ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING
gPrivateBrowsingUI.uninit();
#endif
TabsOnTop.uninit();
@ -1711,7 +1713,9 @@ var gBrowserInit = {
BrowserOffline.uninit();
#ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING
gPrivateBrowsingUI.uninit();
#endif
},
#endif
@ -3498,7 +3502,7 @@ function toOpenWindowByType(inType, uri, features)
window.open(uri, "_blank", "chrome,extrachrome,menubar,resizable,scrollbars,status,toolbar");
}
function OpenBrowserWindow()
function OpenBrowserWindow(options)
{
var telemetryObj = {};
TelemetryStopwatch.start("FX_NEW_WINDOW_MS", telemetryObj);
@ -3519,6 +3523,17 @@ function OpenBrowserWindow()
var defaultArgs = handler.defaultArgs;
var wintype = document.documentElement.getAttribute('windowtype');
var extraFeatures = "";
#ifdef MOZ_PER_WINDOW_PRIVATE_BROWSING
if (typeof options == "object" &&
"private" in options &&
options.private) {
extraFeatures = ",private";
// Force the new window to load about:privatebrowsing instead of the default home page
defaultArgs = "about:privatebrowsing";
}
#endif
// if and only if the current window is a browser window and it has a document with a character
// set, then extract the current charset menu setting from the current document and use it to
// initialize the new browser window...
@ -3529,11 +3544,11 @@ function OpenBrowserWindow()
charsetArg = "charset="+DocCharset;
//we should "inherit" the charset menu setting in a new window
win = window.openDialog("chrome://browser/content/", "_blank", "chrome,all,dialog=no", defaultArgs, charsetArg);
win = window.openDialog("chrome://browser/content/", "_blank", "chrome,all,dialog=no" + extraFeatures, defaultArgs, charsetArg);
}
else // forget about the charset information.
{
win = window.openDialog("chrome://browser/content/", "_blank", "chrome,all,dialog=no", defaultArgs);
win = window.openDialog("chrome://browser/content/", "_blank", "chrome,all,dialog=no" + extraFeatures, defaultArgs);
}
return win;
@ -7043,6 +7058,64 @@ function getTabModalPromptBox(aWindow) {
function getBrowser() gBrowser;
function getNavToolbox() gNavToolbox;
#ifdef MOZ_PER_WINDOW_PRIVATE_BROWSING
# We define a new gPrivateBrowsingUI object, as the per-window PB implementation
# is completely different to the global PB one. Specifically, the per-window
# PB implementation does not expose many APIs on the gPrivateBrowsingUI object,
# and only uses it as a way to initialize and uninitialize private browsing
# windows. While we could use #ifdefs all around the global PB mode code to
# make it work in both modes, the amount of duplicated code is small and the
# code is much more readable this way.
let gPrivateBrowsingUI = {
_inited: false,
_initCallbacks: [],
init: function PBUI_init() {
// Do nothing for normal windows
if (!PrivateBrowsingUtils.isWindowPrivate(window)) {
return;
}
// Disable the Clear Recent History... menu item when in PB mode
// temporary fix until bug 463607 is fixed
document.getElementById("Tools:Sanitize").setAttribute("disabled", "true");
// Adjust the window's title
if (window.location.href == getBrowserURL()) {
let docElement = document.documentElement;
docElement.setAttribute("title",
docElement.getAttribute("title_privatebrowsing"));
docElement.setAttribute("titlemodifier",
docElement.getAttribute("titlemodifier_privatebrowsing"));
docElement.setAttribute("privatebrowsingmode", "temporary");
gBrowser.updateTitlebar();
}
this._inited = true;
this._initCallbacks.forEach(function (callback) callback.apply());
this._initCallbacks = [];
},
get autoStarted() {
return false; // auto-started PB not supported for now
},
get initialized() {
return this._inited;
},
addInitializationCallback: function PBUI_addInitializationCallback(aCallback) {
if (this._inited)
return;
this._initCallbacks.push(aCallback);
}
};
#else
let gPrivateBrowsingUI = {
_privateBrowsingService: null,
_searchBarValue: null,
@ -7296,6 +7369,8 @@ let gPrivateBrowsingUI = {
}
};
#endif
/**
* Switch to a tab that has a given URI, and focusses its browser window.
@ -7523,14 +7598,14 @@ var StyleEditor = {
this.StyleEditorManager.selectEditor(win);
return win;
} else {
return this.StyleEditorManager.newEditor(contentWindow,
return this.StyleEditorManager.newEditor(contentWindow, window,
aSelectedStyleSheet, aLine, aCol);
}
},
toggle: function SE_toggle()
{
this.StyleEditorManager.toggleEditor(gBrowser.contentWindow);
this.StyleEditorManager.toggleEditor(gBrowser.contentWindow, window);
}
};

View File

@ -669,21 +669,30 @@
class="toolbarbutton-1"
type="menu">
<menupopup id="social-statusarea-popup">
<hbox id="social-statusarea-user" pack="start" align="center"
<menuitem id="social-statusarea-user" pack="start" align="center" class="menuitem-iconic"
onclick="SocialUI.showProfile(); document.getElementById('social-statusarea-popup').hidePopup();">
<image id="social-statusarea-user-portrait"/>
<vbox>
<button id="social-statusarea-notloggedin"
class="link" label="&social.notLoggedIn.label;"/>
<button id="social-statusarea-username" class="link"/>
<label id="social-statusarea-notloggedin"
value="&social.notLoggedIn.label;"/>
<label id="social-statusarea-username"/>
</vbox>
</hbox>
</menuitem>
#ifndef XP_WIN
<menuseparator/>
#endif
<menuitem id="social-toggle-sidebar-menuitem"
type="checkbox"
autocheck="false"
command="Social:ToggleSidebar"
label="&social.toggleSidebar.label;"
accesskey="&social.toggleSidebar.accesskey;"/>
<menuitem id="social-toggle-notifications-menuitem"
type="checkbox"
autocheck="false"
command="Social:ToggleNotifications"
label="&social.toggleNotifications.label;"
accesskey="&social.toggleNotifications.accesskey;"/>
</menupopup>
</toolbarbutton>
</toolbaritem>

View File

@ -158,6 +158,7 @@ _BROWSER_FILES = \
browser_bug763468.js \
browser_bug767836.js \
browser_bug783614.js \
browser_bug797677.js \
browser_canonizeURL.js \
browser_customize.js \
browser_findbarClose.js \
@ -240,6 +241,7 @@ _BROWSER_FILES = \
plugin_clickToPlayAllow.html \
plugin_clickToPlayDeny.html \
plugin_bug749455.html \
plugin_bug797677.html \
plugin_hidden_to_visible.html \
plugin_two_types.html \
alltabslistener.html \
@ -296,6 +298,12 @@ _BROWSER_FILES += \
endif
ifdef MOZ_PER_WINDOW_PRIVATE_BROWSING
_BROWSER_FILES += \
browser_private_browsing_window.js \
$(NULL)
endif
include $(topsrcdir)/config/rules.mk
libs:: $(_BROWSER_FILES)

View File

@ -0,0 +1,47 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var rootDir = getRootDirectory(gTestPath);
const gHttpTestRoot = rootDir.replace("chrome://mochitests/content/", "http://127.0.0.1:8888/");
const Cc = Components.classes;
const Ci = Components.interfaces;
var gTestBrowser = null;
var gConsoleErrors = 0;
function test() {
waitForExplicitFinish();
var newTab = gBrowser.addTab();
gBrowser.selectedTab = newTab;
gTestBrowser = gBrowser.selectedBrowser;
gTestBrowser.addEventListener("PluginNotFound", pluginNotFound, true);
var consoleService = Cc["@mozilla.org/consoleservice;1"]
.getService(Ci.nsIConsoleService);
var errorListener = {
observe: function(aMessage) {
if (aMessage.message.contains("NS_ERROR"))
gConsoleErrors++;
}
};
consoleService.registerListener(errorListener);
registerCleanupFunction(function() {
gTestBrowser.removeEventListener("PluginNotFound", pluginNotFound, true);
consoleService.unregisterListener(errorListener);
gBrowser.removeCurrentTab();
window.focus();
});
gTestBrowser.contentWindow.location = gHttpTestRoot + "plugin_bug797677.html";
}
function pluginNotFound() {
// Let browser-plugins.js handle the PluginNotFound event, then run the test
executeSoon(runTest);
}
function runTest() {
var doc = gTestBrowser.contentDocument;
var plugin = doc.getElementById("plugin");
ok(plugin, "plugin should be in the page");
is(gConsoleErrors, 0, "should have no console errors");
finish();
}

View File

@ -97,8 +97,8 @@ function test1() {
ok(notificationBox.getNotificationWithValue("missing-plugins"), "Test 1, Should have displayed the missing plugin notification");
ok(!notificationBox.getNotificationWithValue("blocked-plugins"), "Test 1, Should not have displayed the blocked plugin notification");
ok(gTestBrowser.missingPlugins, "Test 1, Should be a missing plugin list");
ok("application/x-unknown" in gTestBrowser.missingPlugins, "Test 1, Should know about application/x-unknown");
ok(!("application/x-test" in gTestBrowser.missingPlugins), "Test 1, Should not know about application/x-test");
ok(gTestBrowser.missingPlugins.has("application/x-unknown"), "Test 1, Should know about application/x-unknown");
ok(!gTestBrowser.missingPlugins.has("application/x-test"), "Test 1, Should not know about application/x-test");
var pluginNode = gTestBrowser.contentDocument.getElementById("unknown");
ok(pluginNode, "Test 1, Found plugin in page");
@ -162,8 +162,8 @@ function test5() {
ok(!notificationBox.getNotificationWithValue("missing-plugins"), "Test 5, Should not have displayed the missing plugin notification");
ok(notificationBox.getNotificationWithValue("blocked-plugins"), "Test 5, Should have displayed the blocked plugin notification");
ok(gTestBrowser.missingPlugins, "Test 5, Should be a missing plugin list");
ok("application/x-test" in gTestBrowser.missingPlugins, "Test 5, Should know about application/x-test");
ok(!("application/x-unknown" in gTestBrowser.missingPlugins), "Test 5, Should not know about application/x-unknown");
ok(gTestBrowser.missingPlugins.has("application/x-test"), "Test 5, Should know about application/x-test");
ok(!gTestBrowser.missingPlugins.has("application/x-unknown"), "Test 5, Should not know about application/x-unknown");
var pluginNode = gTestBrowser.contentDocument.getElementById("test");
ok(pluginNode, "Test 5, Found plugin in page");
var objLoadingContent = pluginNode.QueryInterface(Ci.nsIObjectLoadingContent);
@ -178,8 +178,8 @@ function test6() {
ok(notificationBox.getNotificationWithValue("missing-plugins"), "Test 6, Should have displayed the missing plugin notification");
ok(!notificationBox.getNotificationWithValue("blocked-plugins"), "Test 6, Should not have displayed the blocked plugin notification");
ok(gTestBrowser.missingPlugins, "Test 6, Should be a missing plugin list");
ok("application/x-unknown" in gTestBrowser.missingPlugins, "Test 6, Should know about application/x-unknown");
ok("application/x-test" in gTestBrowser.missingPlugins, "Test 6, Should know about application/x-test");
ok(gTestBrowser.missingPlugins.has("application/x-unknown"), "Test 6, Should know about application/x-unknown");
ok(gTestBrowser.missingPlugins.has("application/x-test"), "Test 6, Should know about application/x-test");
prepareTest(test7, gTestRoot + "plugin_both2.html");
}
@ -190,8 +190,8 @@ function test7() {
ok(notificationBox.getNotificationWithValue("missing-plugins"), "Test 7, Should have displayed the missing plugin notification");
ok(!notificationBox.getNotificationWithValue("blocked-plugins"), "Test 7, Should not have displayed the blocked plugin notification");
ok(gTestBrowser.missingPlugins, "Test 7, Should be a missing plugin list");
ok("application/x-unknown" in gTestBrowser.missingPlugins, "Test 7, Should know about application/x-unknown");
ok("application/x-test" in gTestBrowser.missingPlugins, "Test 7, Should know about application/x-test");
ok(gTestBrowser.missingPlugins.has("application/x-unknown"), "Test 7, Should know about application/x-unknown");
ok(gTestBrowser.missingPlugins.has("application/x-test"), "Test 7, Should know about application/x-test");
var plugin = getTestPlugin();
plugin.disabled = false;

View File

@ -0,0 +1,11 @@
// Make sure that we can open private browsing windows
function test() {
var nonPrivateWin = OpenBrowserWindow();
ok(!PrivateBrowsingUtils.isWindowPrivate(nonPrivateWin), "OpenBrowserWindow() should open a normal window");
nonPrivateWin.close();
var privateWin = OpenBrowserWindow({private: true});
ok(PrivateBrowsingUtils.isWindowPrivate(privateWin), "OpenBrowserWindow({private: true}) should open a private window");
privateWin.close();
}

View File

@ -10,7 +10,7 @@ function test() {
origin: "https://example.com",
sidebarURL: "https://example.com/browser/browser/base/content/test/social_sidebar.html",
workerURL: "https://example.com/browser/browser/base/content/test/social_worker.js",
iconURL: "chrome://branding/content/icon48.png"
iconURL: "https://example.com/browser/browser/base/content/test/moz.png"
};
runSocialTestWithProvider(manifest, function (finishcb) {
runSocialTests(tests, undefined, undefined, function () {

View File

@ -10,7 +10,7 @@ function test() {
origin: "https://example.com",
sidebarURL: "https://example.com/browser/browser/base/content/test/social_sidebar.html",
workerURL: "https://example.com/browser/browser/base/content/test/social_worker.js",
iconURL: "chrome://branding/content/icon48.png"
iconURL: "https://example.com/browser/browser/base/content/test/moz.png"
};
runSocialTestWithProvider(manifest, function (finishcb) {
runSocialTests(tests, undefined, undefined, finishcb);

View File

@ -10,7 +10,7 @@ function test() {
origin: "https://example.com",
sidebarURL: "https://example.com/browser/browser/base/content/test/social_sidebar.html",
workerURL: "https://example.com/browser/browser/base/content/test/social_worker.js",
iconURL: "chrome://branding/content/icon48.png"
iconURL: "https://example.com/browser/browser/base/content/test/moz.png"
};
runSocialTestWithProvider(manifest, function (finishcb) {
runSocialTests(tests, undefined, undefined, finishcb);

View File

@ -29,7 +29,7 @@ function tabLoaded() {
origin: "https://example.com",
sidebarURL: "https://example.com/browser/browser/base/content/test/social_sidebar.html",
workerURL: "https://example.com/browser/browser/base/content/test/social_worker.js",
iconURL: "chrome://branding/content/icon48.png"
iconURL: "https://example.com/browser/browser/base/content/test/moz.png"
};
runSocialTestWithProvider(manifest, function (finishcb) {
gFinishCB = finishcb;

View File

@ -10,7 +10,7 @@ function test() {
origin: "https://example.com",
sidebarURL: "https://example.com/browser/browser/base/content/test/social_sidebar.html",
workerURL: "https://example.com/browser/browser/base/content/test/social_worker.js",
iconURL: "chrome://branding/content/icon48.png"
iconURL: "https://example.com/browser/browser/base/content/test/moz.png"
};
runSocialTestWithProvider(manifest, doTest);
}

View File

@ -9,7 +9,7 @@ function test() {
name: "provider 1",
origin: "https://example.com",
workerURL: "https://example.com/browser/browser/base/content/test/social_worker.js",
iconURL: "chrome://branding/content/icon48.png"
iconURL: "https://example.com/browser/browser/base/content/test/moz.png"
};
runSocialTestWithProvider(manifest, function (finishcb) {
runSocialTests(tests, undefined, undefined, finishcb);
@ -30,13 +30,13 @@ var tests = {
is(profile.portrait, portrait, "portrait is set");
let userButton = document.getElementById("social-statusarea-username");
ok(!userButton.hidden, "username is visible");
is(userButton.label, profile.userName, "username is set");
is(userButton.value, profile.userName, "username is set");
next();
},
testAmbientNotifications: function(next) {
let ambience = {
name: "testIcon",
iconURL: "chrome://branding/content/icon48.png",
iconURL: "https://example.com/browser/browser/base/content/test/moz.png",
contentPanel: "about:blank",
counter: 42
};
@ -66,6 +66,16 @@ var tests = {
ok(ambientIcon.collapsed, "ambient icon (" + ambientIcon.id + ") is collapsed");
}
next();
},
testShowSidebarMenuitemExists: function(next) {
let toggleSidebarMenuitem = document.getElementById("social-toggle-sidebar-menuitem");
ok(toggleSidebarMenuitem, "Toggle Sidebar menuitem exists");
next();
},
testShowDesktopNotificationsMenuitemExists: function(next) {
let toggleDesktopNotificationsMenuitem = document.getElementById("social-toggle-notifications-menuitem");
ok(toggleDesktopNotificationsMenuitem, "Toggle notifications menuitem exists");
next();
}
}

View File

@ -0,0 +1,5 @@
<!DOCTYPE html>
<html>
<head><meta charset="utf-8"/></head>
<body><embed id="plugin" type="9000"></embed></body>
</html>

View File

@ -14,7 +14,7 @@
!define URLUpdateInfo "http://www.mozilla.org/projects/firefox"
!define URLStubDownload "http://download.mozilla.org/?product=firefox-aurora-latest&os=win&lang=${AB_CD}"
!define URLManualDownload "http://download.mozilla.org/?product=firefox-aurora-latest&os=win&lang=${AB_CD}"
!define URLManualDownload "https://www.mozilla.org/firefox/installer-help/?channel=aurora"
# The installer's certificate name and issuer expected by the stub installer
!define CertNameDownload "Mozilla Corporation"

View File

@ -14,7 +14,7 @@
!define URLUpdateInfo "http://www.mozilla.org/projects/firefox"
!define URLStubDownload "http://download.mozilla.org/?product=firefox-nightly-latest&os=win&lang=${AB_CD}"
!define URLManualDownload "http://download.mozilla.org/?product=firefox-nightly-latest&os=win&lang=${AB_CD}"
!define URLManualDownload "https://www.mozilla.org/firefox/installer-help/?channel=nightly"
# The installer's certificate name and issuer expected by the stub installer
!define CertNameDownload "Mozilla Corporation"

View File

@ -17,7 +17,7 @@
; official branding
!define Official
!define URLStubDownload "http://download.mozilla.org/?product=firefox-latest&os=win&lang=${AB_CD}"
!define URLManualDownload "https://www.mozilla.org/firefox/installer-help/"
!define URLManualDownload "https://www.mozilla.org/firefox/installer-help/?channel=release"
# The installer's certificate name and issuer expected by the stub installer
!define CertNameDownload "Mozilla Corporation"

View File

@ -14,7 +14,7 @@
!define URLUpdateInfo "http://www.mozilla.org/projects/firefox"
!define URLStubDownload "http://download.mozilla.org/?product=firefox-latest&os=win&lang=${AB_CD}"
!define URLManualDownload "http://download.mozilla.org/?product=firefox-latest&os=win&lang=${AB_CD}"
!define URLManualDownload "https://www.mozilla.org/firefox/installer-help/?channel=release"
# The installer's certificate name and issuer expected by the stub installer
!define CertNameDownload "Mozilla Corporation"

View File

@ -177,15 +177,25 @@ const DownloadsButton = {
},
/**
* Indicates whether the indicator is visible in the browser window.
* Checks whether the indicator is, or will soon be visible in the browser
* window.
*
* @param aCallback
* Called once the indicator overlay has loaded. Gets a boolean
* argument representing the indicator visibility.
*/
get isVisible()
checkIsVisible: function DB_checkIsVisible(aCallback)
{
if (!this._placeholder) {
return false;
function DB_CEV_callback() {
if (!this._placeholder) {
aCallback(false);
} else {
let element = DownloadsIndicatorView.indicator || this._placeholder;
aCallback(isElementVisible(element.parentNode));
}
}
let element = DownloadsIndicatorView.indicator || this._placeholder;
return isElementVisible(element.parentNode);
DownloadsOverlayLoader.ensureOverlayLoaded(this.kIndicatorOverlay,
DB_CEV_callback.bind(this));
},
/**

View File

@ -68,17 +68,24 @@ DownloadsUI.prototype = {
}
if (aReason == Ci.nsIDownloadManagerUI.REASON_NEW_DOWNLOAD) {
// If the indicator is visible, then new download notifications are
// already handled by the panel service.
const kMinimized = Ci.nsIDOMChromeWindow.STATE_MINIMIZED;
let browserWin = gBrowserGlue.getMostRecentBrowserWindow();
if (browserWin &&
browserWin.windowState != Ci.nsIDOMChromeWindow.STATE_MINIMIZED &&
browserWin.DownloadsButton.isVisible) {
return;
}
}
this._toolkitUI.show(aWindowContext, aID, aReason);
if (!browserWin || browserWin.windowState == kMinimized) {
this._toolkitUI.show(aWindowContext, aID, aReason);
}
else {
// If the indicator is visible, then new download notifications are
// already handled by the panel service.
browserWin.DownloadsButton.checkIsVisible(function(isVisible) {
if (!isVisible) {
this._toolkitUI.show(aWindowContext, aID, aReason);
}
}.bind(this));
}
} else {
this._toolkitUI.show(aWindowContext, aID, aReason);
}
},
get visible()

View File

@ -351,7 +351,8 @@ BrowserGlue.prototype = {
// handle any UI migration
this._migrateUI();
UserAgentOverrides.init();
this._setUpUserAgentOverrides();
webappsUI.init();
PageThumbs.init();
NewTabUtils.init();
@ -363,6 +364,22 @@ BrowserGlue.prototype = {
Services.obs.notifyObservers(null, "browser-ui-startup-complete", "");
},
_setUpUserAgentOverrides: function BG__setUpUserAgentOverrides() {
UserAgentOverrides.init();
if (Services.prefs.getBoolPref("general.useragent.complexOverride.moodle")) {
UserAgentOverrides.addComplexOverride(function (aHttpChannel, aOriginalUA) {
let cookies;
try {
cookies = aHttpChannel.getRequestHeader("Cookie");
} catch (e) { /* no cookie sent */ }
if (cookies && cookies.indexOf("MoodleSession") > -1)
return aOriginalUA.replace(/Gecko\/[^ ]*/, "Gecko/20100101");
return null;
});
}
},
// the first browser window has finished initializing
_onFirstWindowLoaded: function BG__onFirstWindowLoaded() {
#ifdef XP_WIN

View File

@ -528,30 +528,30 @@ PlacesController.prototype = {
}
var selectionAttr = aMenuItem.getAttribute("selection");
if (selectionAttr) {
if (selectionAttr == "any")
return true;
var showRules = selectionAttr.split("|");
var anyMatched = false;
function metaDataNodeMatches(metaDataNode, rules) {
for (var i=0; i < rules.length; i++) {
if (rules[i] in metaDataNode)
return true;
}
return false;
}
for (var i = 0; i < aMetaData.length; ++i) {
if (metaDataNodeMatches(aMetaData[i], showRules))
anyMatched = true;
else
return false;
}
return anyMatched;
if (!selectionAttr) {
return !aMenuItem.hidden;
}
return !aMenuItem.hidden;
if (selectionAttr == "any")
return true;
var showRules = selectionAttr.split("|");
var anyMatched = false;
function metaDataNodeMatches(metaDataNode, rules) {
for (var i = 0; i < rules.length; i++) {
if (rules[i] in metaDataNode)
return true;
}
return false;
}
for (var i = 0; i < aMetaData.length; ++i) {
if (metaDataNodeMatches(aMetaData[i], showRules))
anyMatched = true;
else
return false;
}
return anyMatched;
},
/**
@ -1021,22 +1021,22 @@ PlacesController.prototype = {
if (!didSuppressNotifications)
result.suppressNotifications = true;
function addData(type, index, overrideURI) {
let wrapNode = PlacesUtils.wrapNode(node, type, overrideURI, doCopy);
dt.mozSetDataAt(type, wrapNode, index);
}
function addURIData(index, overrideURI) {
addData(PlacesUtils.TYPE_X_MOZ_URL, index, overrideURI);
addData(PlacesUtils.TYPE_UNICODE, index, overrideURI);
addData(PlacesUtils.TYPE_HTML, index, overrideURI);
}
try {
let nodes = this._view.draggableSelection;
for (let i = 0; i < nodes.length; ++i) {
var node = nodes[i];
function addData(type, index, overrideURI) {
let wrapNode = PlacesUtils.wrapNode(node, type, overrideURI, doCopy);
dt.mozSetDataAt(type, wrapNode, index);
}
function addURIData(index, overrideURI) {
addData(PlacesUtils.TYPE_X_MOZ_URL, index, overrideURI);
addData(PlacesUtils.TYPE_UNICODE, index, overrideURI);
addData(PlacesUtils.TYPE_HTML, index, overrideURI);
}
// This order is _important_! It controls how this and other
// applications select data to be inserted based on type.
addData(PlacesUtils.TYPE_X_MOZ_PLACE, i);

View File

@ -42,10 +42,9 @@
const Cc = Components.classes;
const Ci = Components.interfaces;
var pb = Cc["@mozilla.org/privatebrowsing;1"].
getService(Ci.nsIPrivateBrowsingService);
Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
if (!pb.privateBrowsingEnabled) {
if (!PrivateBrowsingUtils.isWindowPrivate(window)) {
document.title = "]]>&privatebrowsingpage.title.normal;<![CDATA[";
setFavIcon("chrome://global/skin/icons/question-16.png");
} else {
@ -81,7 +80,7 @@
}
document.addEventListener("DOMContentLoaded", function () {
if (!pb.privateBrowsingEnabled) {
if (!PrivateBrowsingUtils.isWindowPrivate(window)) {
document.body.setAttribute("class", "normal");
}

View File

@ -102,6 +102,12 @@ PrivateBrowsingService.prototype = {
},
_onBeforePrivateBrowsingModeChange: function PBS__onBeforePrivateBrowsingModeChange() {
var windowsEnum = Services.wm.getEnumerator(null);
while (windowsEnum.hasMoreElements()) {
var window = windowsEnum.getNext();
this._setPerWindowPBFlag(window, this._inPrivateBrowsing);
}
// nothing needs to be done here if we're enabling at startup
if (!this._autoStarted) {
let ss = Cc["@mozilla.org/browser/sessionstore;1"].
@ -174,12 +180,6 @@ PrivateBrowsingService.prototype = {
}
else
this._saveSession = false;
var windowsEnum = Services.wm.getEnumerator("navigator:browser");
while (windowsEnum.hasMoreElements()) {
var window = windowsEnum.getNext();
this._setPerWindowPBFlag(window, this._inPrivateBrowsing);
}
},
_onAfterPrivateBrowsingModeChange: function PBS__onAfterPrivateBrowsingModeChange() {

View File

@ -1,6 +1,6 @@
[
{
"clang_version": "r163716"
"clang_version": "r164411"
},
{
"size": 47,
@ -9,8 +9,8 @@
"filename": "setup.sh"
},
{
"size": 61047821,
"digest": "964837fd04d0ff7b0c01ca6ed8f3716256b9334e0d1200a7a06235bf837a75d41371d389b401cc15744ff509ecf96f31bdc0e679a0b3a6be93090673d5432ba4",
"size": 60016787,
"digest": "84d420e0eef930263a92d1bbec7555d939eb74f5ad95b25ea3b00a5f366d38fd16fe1e7713b937e53b1f25928d8bce3dcc7f80f71c805fe27b779fb34980727a",
"algorithm": "sha512",
"filename": "clang.tar.bz2"
}

View File

@ -1,6 +1,6 @@
[
{
"clang_version": "r163716"
"clang_version": "r164411"
},
{
"size": 47,
@ -9,8 +9,8 @@
"filename": "setup.sh"
},
{
"size": 61004559,
"digest": "32d995275a00ed3f7ea79a4057c84108b2e1ebf13e89f05c96893b0e3602dc4891d962d8a61dbe5a395beb0fa6932ab90d5d3fa7eef7b95c092a7974e4cbd625",
"size": 60915944,
"digest": "ca69b71ca9d6149db541cba42079c9cf57b5f6934c4b145cb6657fc193e7268b4724a4da318121c6f08518b5dc3bf58c69135a5e405b1f614ca155065261c2d1",
"algorithm": "sha512",
"filename": "clang.tar.bz2"
}

View File

@ -1,6 +1,6 @@
[
{
"clang_version": "r163716"
"clang_version": "r164411"
},
{
"size": 47,
@ -9,8 +9,8 @@
"filename": "setup.sh"
},
{
"size": 54033946,
"digest": "50eb6fa636403f444bab10aee2370f1ac624a1e0105566639c7c266e784dbc6e4cd3901bbd11f53c4c63b2a6d2d07a603b3d9c333f5049bdc7a816b7d225631b",
"size": 54336567,
"digest": "f692fb99c0faae0e850d0fba1ea1905064c00b7c65c03367369fec685771511c4e97445139be8eaa1bb6380055594cebef1e23cc0fd0717203411cd8082f37fa",
"algorithm": "sha512",
"filename": "clang.tar.bz2"
}

View File

@ -1,6 +1,6 @@
[
{
"clang_version": "r163716"
"clang_version": "r164411"
},
{
"size": 47,
@ -9,8 +9,8 @@
"filename": "setup.sh"
},
{
"size": 54033946,
"digest": "50eb6fa636403f444bab10aee2370f1ac624a1e0105566639c7c266e784dbc6e4cd3901bbd11f53c4c63b2a6d2d07a603b3d9c333f5049bdc7a816b7d225631b",
"size": 54336567,
"digest": "f692fb99c0faae0e850d0fba1ea1905064c00b7c65c03367369fec685771511c4e97445139be8eaa1bb6380055594cebef1e23cc0fd0717203411cd8082f37fa",
"algorithm": "sha512",
"filename": "clang.tar.bz2"
}

View File

@ -375,6 +375,10 @@ StyleEditor.prototype = {
this._friendlyName = (sheetURI.indexOf(contentURI) == 0)
? sheetURI.substring(contentURI.length)
: sheetURI;
try {
this._friendlyName = decodeURI(this._friendlyName);
} catch (ex) {
}
}
return this._friendlyName;
},
@ -1311,11 +1315,12 @@ StyleEditorManager.prototype = {
* Open a new editor.
*
* @param {Window} content window.
* @param {Window} chrome window.
* @param {CSSStyleSheet} [aSelectedStyleSheet] default Stylesheet.
* @param {Number} [aLine] Line to which the caret should be moved (one-indexed).
* @param {Number} [aCol] Column to which the caret should be moved (one-indexed).
*/
newEditor: function SEM_newEditor(aContentWindow, aSelectedStyleSheet, aLine, aCol) {
newEditor: function SEM_newEditor(aContentWindow, aChromeWindow, aSelectedStyleSheet, aLine, aCol) {
const CHROME_URL = "chrome://browser/content/styleeditor.xul";
const CHROME_WINDOW_FLAGS = "chrome,centerscreen,resizable,dialog=no";
@ -1326,7 +1331,7 @@ StyleEditorManager.prototype = {
col: aCol
};
args.wrappedJSObject = args;
let chromeWindow = Services.ww.openWindow(null, CHROME_URL, "_blank",
let chromeWindow = Services.ww.openWindow(aChromeWindow, CHROME_URL, "_blank",
CHROME_WINDOW_FLAGS, args);
chromeWindow.onunload = function() {
@ -1349,12 +1354,12 @@ StyleEditorManager.prototype = {
*
* @param {Window} associated content window.
*/
toggleEditor: function SEM_toggleEditor(aContentWindow) {
toggleEditor: function SEM_toggleEditor(aContentWindow, aChromeWindow) {
let editor = this.getEditorForWindow(aContentWindow);
if (editor) {
editor.close();
} else {
this.newEditor(aContentWindow);
this.newEditor(aContentWindow, aChromeWindow);
}
},

View File

@ -6,6 +6,8 @@
// content CSS files in the permanent cache when opened from PB mode.
function checkDiskCacheFor(host) {
let foundPrivateData = false;
let visitor = {
visitDevice: function(deviceID, deviceInfo) {
if (deviceID == "disk")
@ -15,10 +17,12 @@ function checkDiskCacheFor(host) {
visitEntry: function(deviceID, entryInfo) {
info(entryInfo.key);
is(entryInfo.key.contains(host), false, "web content present in disk cache");
foundPrivateData |= entryInfo.key.contains(host);
is(foundPrivateData, false, "web content present in disk cache");
}
};
cache.visitEntries(visitor);
is(foundPrivateData, false, "private data present in disk cache");
}
const TEST_HOST = 'mochi.test:8888';

View File

@ -96,7 +96,7 @@ Var CTL_RIGHT_PX
!undef URLStubDownload
!define URLStubDownload "http://download.mozilla.org/?product=firefox-beta-latest&os=win&lang=${AB_CD}"
!undef URLManualDownload
!define URLManualDownload "http://download.mozilla.org/?product=firefox-beta-latest&os=win&lang=${AB_CD}"
!define URLManualDownload "https://www.mozilla.org/firefox/installer-help/?channel=beta"
!endif
!endif
@ -1204,15 +1204,16 @@ Function ExecSetAsDefaultAppUser
FunctionEnd
Function LaunchApp
FindWindow $0 "${WindowClass}"
${If} $0 <> 0 ; integer comparison
MessageBox MB_OK|MB_ICONQUESTION "$(WARN_MANUALLY_CLOSE_APP_LAUNCH)"
Return
${EndIf}
ClearErrors
${GetParameters} $0
${GetOptions} "$0" "/UAC:" $1
${If} ${Errors}
FindWindow $0 "${WindowClass}"
${If} $0 <> 0 ; integer comparison
MessageBox MB_OK|MB_ICONQUESTION "$(WARN_MANUALLY_CLOSE_APP_LAUNCH)"
Return
${EndIf}
Exec "$\"$INSTDIR\${FileMainEXE}$\""
${Else}
GetFunctionAddress $0 LaunchAppFromElevatedProcess
@ -1221,12 +1222,6 @@ Function LaunchApp
FunctionEnd
Function LaunchAppFromElevatedProcess
FindWindow $0 "${WindowClass}"
${If} $0 <> 0 ; integer comparison
MessageBox MB_OK|MB_ICONQUESTION "$(WARN_MANUALLY_CLOSE_APP_LAUNCH)"
Return
${EndIf}
; Find the installation directory when launching using GetFunctionAddress
; from an elevated installer since $INSTDIR will not be set in this installer
${StrFilter} "${FileMainEXE}" "+" "" "" $R9

View File

@ -17,12 +17,6 @@ browser.contentHandlers.types.0.uri=http://fusion.google.com/add?feedurl=%s
browser.contentHandlers.types.1.title=My Yahoo!
browser.contentHandlers.types.1.uri=http://add.my.yahoo.com/rss?url=%s
# URL for site-specific search engines
# TRANSLATION NOTE: {moz:domain} and {searchTerms} are placeholders for the site
# to be searched and the user's search query. Place them in the appropriate location
# for your locale's URL but do not translate them.
browser.search.siteSearchURL=https://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=navclient&q=site%3A{moz:domain}+{searchTerms}
# increment this number when anything gets changed in the list below. This will
# cause Firefox to re-read these prefs and inject any new handlers into the
# profile database. Note that "new" is defined as "has a different URL"; this

View File

@ -63,7 +63,7 @@ can reach it easily. -->
<!ENTITY printCmd.commandkey "p">
<!ENTITY goOfflineCmd.label "Work Offline">
<!ENTITY goOfflineCmd.accesskey "w">
<!ENTITY goOfflineCmd.accesskey "k">
<!ENTITY menubarCmd.label "Menu Bar">
<!ENTITY menubarCmd.accesskey "M">
@ -277,6 +277,8 @@ These should match what Safari and other Apple applications use on OS X Lion. --
<!ENTITY newNavigatorCmd.label "New Window">
<!ENTITY newNavigatorCmd.key "N">
<!ENTITY newNavigatorCmd.accesskey "N">
<!ENTITY newPrivateWindow.label "New Private Window">
<!ENTITY newPrivateWindow.accesskey "W">
<!ENTITY editMenu.label "Edit">
<!ENTITY editMenu.accesskey "E">

View File

@ -2684,16 +2684,6 @@ html|*#gcli-output-frame {
margin-right: -12px;
}
#social-statusarea-user {
border-bottom: 1px solid rgb(221,221,221);
background-color: -moz-Dialog;
color: -moz-dialogtext;
position: relative;
font: message-box;
font-size: 12px;
cursor: pointer;
}
#social-statusarea-user-portrait {
width: 32px;
height: 32px;
@ -2701,19 +2691,6 @@ html|*#gcli-output-frame {
margin: 10px;
}
#social-statusarea-user > vbox > .link {
-moz-appearance: none;
background: transparent;
border: none;
color: -moz-nativehyperlinktext;
min-width: 0;
margin: 0 6px;
list-style-image: none;
}
#social-statusarea-user:hover > vbox > .link {
text-decoration: underline;
}
.social-panel > .panel-arrowcontainer > .panel-arrowcontent {
padding: 0;
}
@ -2897,7 +2874,7 @@ chatbox[minimized="true"] {
}
.center-item-box[warn="true"] {
background-image: url("chrome://mozapps/skin/extensions/stripes-info-negative-small.png");
background-image: url("chrome://browser/skin/click-to-play-warning-stripes.png");
background-repeat: repeat-x;
padding-top: 7px;
-moz-padding-end: 11px;

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -40,6 +40,7 @@ browser.jar:
skin/classic/browser/Secure.png
skin/classic/browser/Security-broken.png
skin/classic/browser/setDesktopBackground.css
skin/classic/browser/click-to-play-warning-stripes.png
skin/classic/browser/Toolbar.png
skin/classic/browser/Toolbar-small.png
skin/classic/browser/urlbar-arrow.png

View File

@ -4100,29 +4100,11 @@ html|*#gcli-output-frame {
/* === social toolbar provider menu === */
#social-statusarea-user {
cursor: default;
font-family: "lucida grande",tahoma,verdana,arial,sans-serif;
font-size: 12px;
cursor: pointer;
}
#social-statusarea-user-portrait {
width: 32px;
height: 32px;
margin: 10px;
}
#social-statusarea-user > vbox > .link {
-moz-appearance: none;
color: -moz-nativehyperlinktext;
min-width: 0;
margin: 0 6px;
list-style-image: none;
}
#social-statusarea-user:hover > vbox > .link {
text-decoration: underline;
margin: 4px;
-moz-margin-start: 0;
}
.social-panel > .panel-arrowcontainer > .panel-arrowcontent {
@ -4334,7 +4316,7 @@ panel[type="arrow"][popupid="click-to-play-plugins"] > .panel-arrowcontainer > .
}
.center-item-box[warn="true"] {
background-image: url("chrome://mozapps/skin/extensions/stripes-info-negative-small.png");
background-image: url("chrome://browser/skin/click-to-play-warning-stripes.png");
background-repeat: repeat-x;
padding-top: 3px;
-moz-padding-end: 11px;

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -57,6 +57,7 @@ browser.jar:
skin/classic/browser/Search@2x.png
skin/classic/browser/Secure-Glyph.png
skin/classic/browser/Secure-Glyph@2x.png
skin/classic/browser/click-to-play-warning-stripes.png
skin/classic/browser/keyhole-circle.png
skin/classic/browser/Toolbar.png
skin/classic/browser/toolbarbutton-dropmarker.png

View File

@ -3361,12 +3361,10 @@ html|*#gcli-output-frame {
}
#social-statusarea-user {
-moz-appearance: none;
border-bottom: 1px solid rgb(221,221,221);
background-color: -moz-Dialog;
color: -moz-dialogtext;
position: relative;
font: message-box;
font-size: 12px;
cursor: pointer;
}
@ -3377,7 +3375,8 @@ html|*#gcli-output-frame {
margin: 10px;
}
#social-statusarea-user > vbox > .link {
#social-statusarea-user > vbox > #social-statusarea-notloggedin,
#social-statusarea-user > vbox > #social-statusarea-username {
-moz-appearance: none;
background: transparent;
border: none;
@ -3386,7 +3385,9 @@ html|*#gcli-output-frame {
margin: 0 6px;
list-style-image: none;
}
#social-statusarea-user:hover > vbox > .link {
#social-statusarea-user[_moz-menuactive] > vbox > #social-statusarea-notloggedin,
#social-statusarea-user[_moz-menuactive] > vbox > #social-statusarea-username {
text-decoration: underline;
}
@ -3598,7 +3599,7 @@ chatbox[minimized="true"] {
}
.center-item-box[warn="true"] {
background-image: url("chrome://mozapps/skin/extensions/stripes-info-negative-small.png");
background-image: url("chrome://browser/skin/click-to-play-warning-stripes.png");
background-repeat: repeat-x;
padding: 8px 16px 6px 16px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -49,6 +49,7 @@ browser.jar:
skin/classic/browser/searchbar-dropdown-arrow.png
skin/classic/browser/Secure24.png
skin/classic/browser/setDesktopBackground.css
skin/classic/browser/click-to-play-warning-stripes.png
skin/classic/browser/Toolbar.png
skin/classic/browser/Toolbar-inverted.png
skin/classic/browser/toolbarbutton-dropdown-arrow.png
@ -254,6 +255,7 @@ browser.jar:
skin/classic/aero/browser/searchbar-dropdown-arrow.png (searchbar-dropdown-arrow-aero.png)
skin/classic/aero/browser/Secure24.png (Secure24-aero.png)
skin/classic/aero/browser/setDesktopBackground.css
skin/classic/aero/browser/click-to-play-warning-stripes.png
skin/classic/aero/browser/Toolbar.png
skin/classic/aero/browser/Toolbar-inverted.png
skin/classic/aero/browser/toolbarbutton-dropdown-arrow.png

View File

@ -15,11 +15,6 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver android:name=".SUTStartupIntentReceiver">
<intent-filter>
<action android:name="android.intent.action.MEDIA_MOUNTED"></action>
</intent-filter>
</receiver>
<service android:name=".service.ASMozStub">
<intent-filter>
<action android:name="com.mozilla.SUTAgentAndroid.service.LISTENER_SERVICE" />

View File

@ -1314,23 +1314,33 @@ private void CancelNotification()
public String GetTestRoot()
{
String sRet = null;
File tmpFile = new java.io.File("/data/local/tests");
if (tmpFile.exists() && tmpFile.isDirectory())
// According to all the docs this should work, but I keep getting an
// exception when I attempt to create the file because I don't have
// permission, although /data/local/tmp is supposed to be world
// writeable/readable
File tmpFile = new java.io.File("/data/local/tmp/tests");
try{
tmpFile.createNewFile();
} catch (IOException e){
Log.i("SUTAgentAndroid", "Caught exception creating file in /data/local/tmp: " + e.getMessage());
}
String state = Environment.getExternalStorageState();
// Ensure sdcard is mounted and NOT read only
if (state.equalsIgnoreCase(Environment.MEDIA_MOUNTED) &&
(Environment.MEDIA_MOUNTED_READ_ONLY.compareTo(state) != 0))
{
return(Environment.getExternalStorageDirectory().getAbsolutePath());
}
if (tmpFile.exists())
{
Log.i("CLINT", "tmpfile exists");
return("/data/local");
}
if (Environment.getExternalStorageState().equalsIgnoreCase(Environment.MEDIA_MOUNTED))
{
sRet = Environment.getExternalStorageDirectory().getAbsolutePath();
}
else
{
sRet = GetTmpDir();
}
Log.e("SUTAgentAndroid", "ERROR: Cannot access world writeable test root");
return(sRet);
return(null);
}
public String GetAppRoot(String AppName)

View File

@ -24,7 +24,6 @@ JAVAFILES = \
RunCmdThread.java \
RunDataThread.java \
SUTAgentAndroid.java \
SUTStartupIntentReceiver.java \
WifiConfiguration.java \
R.java \
$(NULL)

View File

@ -109,6 +109,12 @@ public class SUTAgentAndroid extends Activity
String today = "";
String yesterday = "";
// test root can be null (if getTestRoot fails), handle that:
if (testroot == null) {
testroot = "";
}
try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss:SSS");
Date dateObj = sdf.parse(datestamp);
@ -746,8 +752,8 @@ public class SUTAgentAndroid extends Activity
if (sHWID != null)
return sHWID;
// If we're on SDK version >= 8, use Build.SERIAL
if (android.os.Build.VERSION.SDK_INT >= 8) {
// If we're on SDK version > 8, use Build.SERIAL
if (android.os.Build.VERSION.SDK_INT > 8) {
sHWID = android.os.Build.SERIAL;
}

View File

@ -1,20 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package com.mozilla.SUTAgentAndroid;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
public class SUTStartupIntentReceiver extends BroadcastReceiver
{
@Override
public void onReceive(Context context, Intent intent)
{
Intent mySUTAgentIntent = new Intent(context, SUTAgentAndroid.class);
mySUTAgentIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(mySUTAgentIntent);
}
}

View File

@ -42,6 +42,7 @@ import android.provider.Settings;
import android.util.Log;
import android.view.Gravity;
import android.widget.Toast;
import android.os.Environment;
public class WatcherService extends Service
{
@ -489,9 +490,9 @@ public class WatcherService extends Service
if (strProcName.contains(sProcName))
{
bRet = true;
break;
}
}
return (bRet);
}
@ -895,6 +896,8 @@ public class WatcherService extends Service
private class MyTime extends TimerTask
{
int nStrikes = 0;
final int PERIODS_TO_WAIT_FOR_SDCARD = 3;
int nPeriodsWaited = 0;
public MyTime()
{
@ -931,8 +934,23 @@ public class WatcherService extends Service
// Debug.waitForDebugger();
// Ensure the sdcard is mounted before we even attempt to start the agent
// We will wait for the sdcard to mount for PERIODS_TO_WAIT_FOR_SDCARD
// after which time we go ahead and attempt to start the agent.
if (nPeriodsWaited++ < PERIODS_TO_WAIT_FOR_SDCARD) {
String state = Environment.getExternalStorageState();
if (Environment.MEDIA_MOUNTED.compareTo(state) != 0) {
Log.i("SUTAgentWatcher", "SDcard not mounted, waiting another turn");
return;
} else if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {
Log.e("SUTAgentWatcher", "SDcard mounted read only not starting agent now, try again in 60s");
return;
}
}
if (bStartSUTAgent && !GetProcessInfo(sProgramName))
{
Log.i("SUTAgentWatcher", "Starting SUTAgent from watcher code");
Intent agentIntent = new Intent();
agentIntent.setPackage(sProgramName);
agentIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

View File

@ -3,7 +3,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
llvm_revision = "163716"
llvm_revision = "164411"
moz_version = "moz0"
##############################################
@ -111,9 +111,6 @@ def build_one_stage_aux(stage_dir, is_stage_one):
"--disable-assertions",
"--prefix=%s" % inst_dir,
"--with-gcc-toolchain=/tools/gcc-4.5-0moz3"]
if is_stage_one and not isDarwin:
configure_opts.append("--with-optimize-option=-O0")
build_package(llvm_source_dir, build_dir, configure_opts)
if isDarwin:
@ -130,11 +127,7 @@ if not os.path.exists(source_dir):
os.symlink("../../clang", llvm_source_dir + "/tools/clang")
os.symlink("../../compiler-rt", llvm_source_dir + "/projects/compiler-rt")
patch("llvm-debug-frame.patch", 1, llvm_source_dir)
patch("llvm-deterministic.patch", 1, llvm_source_dir)
patch("clang-deterministic.patch", 1, clang_source_dir)
if not isDarwin:
patch("old-ld-hack.patch", 1, llvm_source_dir)
patch("compiler-rt-gnu89-inline.patch", 1, compiler_rt_source_dir)
patch("no-sse-on-linux.patch", 1, clang_source_dir)
if os.path.exists(build_dir):
@ -152,16 +145,13 @@ if isDarwin:
else:
extra_cflags = "-static-libgcc"
extra_cxxflags = "-static-libgcc -static-libstdc++"
cc = "/tools/gcc-4.5-0moz3/bin/gcc %s" % extra_cflags
cxx = "/tools/gcc-4.5-0moz3/bin/g++ %s" % extra_cxxflags
cc = "/usr/bin/gcc"
cxx = "/usr/bin/g++"
build_one_stage({"CC" : cc,
"CXX" : cxx },
stage1_dir, True)
if not isDarwin:
extra_cflags += " -fgnu89-inline"
stage2_dir = build_dir + '/stage2'
build_one_stage({"CC" : stage1_inst_dir + "/bin/clang %s" % extra_cflags,
"CXX" : stage1_inst_dir + "/bin/clang++ %s" % extra_cxxflags},

View File

@ -1,45 +0,0 @@
diff --git a/include/clang/AST/CXXInheritance.h b/include/clang/AST/CXXInheritance.h
index ee6eba7..87bdbe0 100644
--- a/include/clang/AST/CXXInheritance.h
+++ b/include/clang/AST/CXXInheritance.h
@@ -19,7 +19,7 @@
#include "clang/AST/DeclCXX.h"
#include "clang/AST/Type.h"
#include "clang/AST/TypeOrdering.h"
-#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/SmallVector.h"
#include <list>
@@ -271,15 +271,14 @@ struct UniqueVirtualMethod {
/// pair is the virtual method that overrides it (including the
/// subobject in which that virtual function occurs).
class OverridingMethods {
- llvm::DenseMap<unsigned, SmallVector<UniqueVirtualMethod, 4> >
- Overrides;
+ typedef SmallVector<UniqueVirtualMethod, 4> ValuesT;
+ typedef llvm::MapVector<unsigned, ValuesT> MapType;
+ MapType Overrides;
public:
// Iterate over the set of subobjects that have overriding methods.
- typedef llvm::DenseMap<unsigned, SmallVector<UniqueVirtualMethod, 4> >
- ::iterator iterator;
- typedef llvm::DenseMap<unsigned, SmallVector<UniqueVirtualMethod, 4> >
- ::const_iterator const_iterator;
+ typedef MapType::iterator iterator;
+ typedef MapType::const_iterator const_iterator;
iterator begin() { return Overrides.begin(); }
const_iterator begin() const { return Overrides.begin(); }
iterator end() { return Overrides.end(); }
@@ -357,8 +356,8 @@ public:
/// 0 represents the virtua base class subobject of that type, while
/// subobject numbers greater than 0 refer to non-virtual base class
/// subobjects of that type.
-class CXXFinalOverriderMap
- : public llvm::DenseMap<const CXXMethodDecl *, OverridingMethods> { };
+class CXXFinalOverriderMap
+ : public llvm::MapVector<const CXXMethodDecl *, OverridingMethods> { };
/// \brief A set of all the primary bases for a class.
class CXXIndirectPrimaryBaseSet

View File

@ -1,10 +0,0 @@
diff --git a/make/config.mk b/make/config.mk
index 12d8bc2..9a6cab5 100644
--- a/make/config.mk
+++ b/make/config.mk
@@ -43,4 +43,4 @@ endif
###
# Common compiler options
COMMON_CXXFLAGS=-fno-exceptions -fPIC -funwind-tables -I${ProjSrcRoot}/lib -I${ProjSrcRoot}/include
-COMMON_CFLAGS=-fPIC
+COMMON_CFLAGS=-fPIC -fgnu89-inline

View File

@ -1,86 +0,0 @@
diff --git a/include/llvm/ADT/MapVector.h b/include/llvm/ADT/MapVector.h
new file mode 100644
index 0000000..bad207b
--- /dev/null
+++ b/include/llvm/ADT/MapVector.h
@@ -0,0 +1,80 @@
+//===- llvm/ADT/MapVector.h - Map with deterministic value order *- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements a map that provides insertion order iteration. The
+// interface is purposefully minimal. The key is assumed to be cheap to copy
+// and 2 copies are kept, one for indexing in a DenseMap, one for iteration in
+// a std::vector.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ADT_MAPVECTOR_H
+#define LLVM_ADT_MAPVECTOR_H
+
+#include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/DenseMap.h"
+#include <vector>
+
+namespace llvm {
+
+/// This class implements a map that also provides access to all stored values
+/// in a deterministic order. The values are kept in a std::vector and the
+/// mapping is done with DenseMap from Keys to indexes in that vector.
+template<typename KeyT, typename ValueT>
+class MapVector {
+ typedef llvm::DenseMap<KeyT, unsigned> MapType;
+ typedef std::vector<std::pair<KeyT, ValueT> > VectorType;
+ typedef typename VectorType::size_type SizeType;
+
+ MapType Map;
+ VectorType Vector;
+
+public:
+ typedef typename VectorType::iterator iterator;
+ typedef typename VectorType::const_iterator const_iterator;
+
+ SizeType size() const {
+ return Vector.size();
+ }
+
+ iterator begin() {
+ return Vector.begin();
+ }
+
+ const_iterator begin() const {
+ return Vector.begin();
+ }
+
+ iterator end() {
+ return Vector.end();
+ }
+
+ const_iterator end() const {
+ return Vector.end();
+ }
+
+ bool empty() const {
+ return Vector.empty();
+ }
+
+ ValueT &operator[](const KeyT &Key) {
+ std::pair<KeyT, unsigned> Pair = std::make_pair(Key, 0);
+ std::pair<typename MapType::iterator, bool> Result = Map.insert(Pair);
+ unsigned &I = Result.first->second;
+ if (Result.second) {
+ Vector.push_back(std::make_pair(Key, ValueT()));
+ I = Vector.size() - 1;
+ }
+ return Vector[I].second;
+ }
+};
+
+}
+
+#endif

View File

@ -1,120 +0,0 @@
diff --git a/include/llvm/MC/MCStreamer.h b/include/llvm/MC/MCStreamer.h
index 9932306..948caa8 100644
--- a/include/llvm/MC/MCStreamer.h
+++ b/include/llvm/MC/MCStreamer.h
@@ -116,7 +116,7 @@ namespace llvm {
return FrameInfos[i];
}
- ArrayRef<MCDwarfFrameInfo> getFrameInfos() {
+ MutableArrayRef<MCDwarfFrameInfo> getFrameInfos() {
return FrameInfos;
}
diff --git a/lib/MC/MCDwarf.cpp b/lib/MC/MCDwarf.cpp
index e16f7ae..edf1d6d 100644
--- a/lib/MC/MCDwarf.cpp
+++ b/lib/MC/MCDwarf.cpp
@@ -859,7 +859,6 @@ namespace {
const MCSymbol &EmitCIE(MCStreamer &streamer,
const MCSymbol *personality,
unsigned personalityEncoding,
- const MCSymbol *lsda,
bool IsSignalFrame,
unsigned lsdaEncoding);
MCSymbol *EmitFDE(MCStreamer &streamer,
@@ -1131,7 +1130,6 @@ bool FrameEmitterImpl::EmitCompactUnwind(MCStreamer &Streamer,
const MCSymbol &FrameEmitterImpl::EmitCIE(MCStreamer &streamer,
const MCSymbol *personality,
unsigned personalityEncoding,
- const MCSymbol *lsda,
bool IsSignalFrame,
unsigned lsdaEncoding) {
MCContext &context = streamer.getContext();
@@ -1172,7 +1170,7 @@ const MCSymbol &FrameEmitterImpl::EmitCIE(MCStreamer &streamer,
Augmentation += "z";
if (personality)
Augmentation += "P";
- if (lsda)
+ if (lsdaEncoding)
Augmentation += "L";
Augmentation += "R";
if (IsSignalFrame)
@@ -1203,7 +1201,7 @@ const MCSymbol &FrameEmitterImpl::EmitCIE(MCStreamer &streamer,
// Personality
augmentationLength += getSizeForEncoding(streamer, personalityEncoding);
}
- if (lsda)
+ if (lsdaEncoding)
augmentationLength += 1;
// Encoding of the FDE pointers
augmentationLength += 1;
@@ -1221,7 +1219,7 @@ const MCSymbol &FrameEmitterImpl::EmitCIE(MCStreamer &streamer,
EmitPersonality(streamer, *personality, personalityEncoding);
}
- if (lsda)
+ if (lsdaEncoding)
EmitEncodingByte(streamer, lsdaEncoding, "LSDA Encoding");
// Encoding of the FDE pointers
@@ -1322,6 +1320,8 @@ MCSymbol *FrameEmitterImpl::EmitFDE(MCStreamer &streamer,
if (frame.Lsda)
EmitSymbol(streamer, *frame.Lsda, frame.LsdaEncoding,
"Language Specific Data Area");
+ else if (frame.LsdaEncoding)
+ streamer.EmitIntValue(0, 4);
}
// Call Frame Instructions
@@ -1385,7 +1385,7 @@ void MCDwarfFrameEmitter::Emit(MCStreamer &Streamer,
MCObjectFileInfo *MOFI =
const_cast<MCObjectFileInfo*>(Context.getObjectFileInfo());
FrameEmitterImpl Emitter(UsingCFI, IsEH);
- ArrayRef<MCDwarfFrameInfo> FrameArray = Streamer.getFrameInfos();
+ MutableArrayRef<MCDwarfFrameInfo> FrameArray = Streamer.getFrameInfos();
// Emit the compact unwind info if available.
if (IsEH && MOFI->getCompactUnwindSection())
@@ -1405,7 +1405,31 @@ void MCDwarfFrameEmitter::Emit(MCStreamer &Streamer,
MCSymbol *FDEEnd = NULL;
DenseMap<CIEKey, const MCSymbol*> CIEStarts;
- const MCSymbol *DummyDebugKey = NULL;
+
+ const MCSymbol *HackPersonality = NULL;
+ unsigned HackLsdaEncoding = 0;
+ unsigned HackPersonalityEncoding = 0;
+ for (unsigned i = 0, n = FrameArray.size(); i < n; ++i) {
+ const MCDwarfFrameInfo &Frame = FrameArray[i];
+ if (!HackPersonality)
+ HackPersonality = Frame.Personality;
+ if (!HackLsdaEncoding)
+ HackLsdaEncoding = Frame.LsdaEncoding;
+ if (!HackPersonalityEncoding)
+ HackPersonalityEncoding = Frame.PersonalityEncoding;
+ }
+
+ for (unsigned i = 0, n = FrameArray.size(); i < n; ++i) {
+ MCDwarfFrameInfo &Frame = FrameArray[i];
+ assert(Frame.Personality == NULL || Frame.Personality == HackPersonality);
+ Frame.Personality = HackPersonality;
+ assert(Frame.LsdaEncoding == 0 || Frame.LsdaEncoding == HackLsdaEncoding);
+ Frame.LsdaEncoding = HackLsdaEncoding;
+ assert(Frame.PersonalityEncoding == 0 || Frame.PersonalityEncoding == HackPersonalityEncoding);
+ Frame.PersonalityEncoding = HackPersonalityEncoding;
+ }
+
+ const MCSymbol *DummyDebugKey = NULL;
for (unsigned i = 0, n = FrameArray.size(); i < n; ++i) {
const MCDwarfFrameInfo &Frame = FrameArray[i];
CIEKey Key(Frame.Personality, Frame.PersonalityEncoding,
@@ -1413,7 +1437,7 @@ void MCDwarfFrameEmitter::Emit(MCStreamer &Streamer,
const MCSymbol *&CIEStart = IsEH ? CIEStarts[Key] : DummyDebugKey;
if (!CIEStart)
CIEStart = &Emitter.EmitCIE(Streamer, Frame.Personality,
- Frame.PersonalityEncoding, Frame.Lsda,
+ Frame.PersonalityEncoding,
Frame.IsSignalFrame,
Frame.LsdaEncoding);

View File

@ -10,7 +10,7 @@ interface nsIURI;
interface nsIChannel;
interface nsIDocShell;
[scriptable, uuid(51289544-fd8a-11e1-8017-5abf937d8bec)]
[scriptable, uuid(2182f772-16c8-4b6d-be65-921d4da5751d)]
interface nsIScriptSecurityManager : nsIXPCSecurityManager
{
///////////////// Security Checks //////////////////
@ -266,9 +266,6 @@ interface nsIScriptSecurityManager : nsIXPCSecurityManager
* principal.
*/
[noscript,notxpcom] nsIPrincipal getCxSubjectPrincipal(in JSContextPtr cx);
[noscript,notxpcom] nsIPrincipal getCxSubjectPrincipalAndFrame(in JSContextPtr cx,
out JSStackFramePtr fp);
const unsigned long NO_APP_ID = 0;
const unsigned long UNKNOWN_APP_ID = 4294967295; // UINT32_MAX

View File

@ -370,20 +370,6 @@ nsScriptSecurityManager::GetCxSubjectPrincipal(JSContext *cx)
return principal;
}
NS_IMETHODIMP_(nsIPrincipal *)
nsScriptSecurityManager::GetCxSubjectPrincipalAndFrame(JSContext *cx, JSStackFrame **fp)
{
NS_ASSERTION(cx == GetCurrentJSContext(),
"Uh, cx is not the current JS context!");
nsresult rv = NS_ERROR_FAILURE;
nsIPrincipal *principal = GetPrincipalAndFrame(cx, fp, &rv);
if (NS_FAILED(rv))
return nullptr;
return principal;
}
////////////////////
// Policy Storage //
////////////////////

View File

@ -4321,7 +4321,11 @@ case "${target}" in
fi
NSS_DISABLE_DBM=1
NECKO_WIFI=
if test -z "$gonkdir"; then
NECKO_WIFI=
else
NECKO_WIFI=1
fi
MOZ_THEME_FASTSTRIPE=1
MOZ_TREE_FREETYPE=1
MOZ_MEMORY=1
@ -8194,14 +8198,6 @@ if test "$NECKO_WIFI" -a \
AC_MSG_ERROR([Necko WiFi scanning not supported on your platform, use --disable-necko-wifi])
fi
if test -z "$SKIP_LIBRARY_CHECKS" -a "$NECKO_WIFI" -a "$OS_ARCH" = "Linux"
then
MOZ_CHECK_HEADER([iwlib.h])
if test "$ac_cv_header_iwlib_h" != "yes"; then
AC_MSG_ERROR([Can't find header iwlib.h for Necko WiFi scanning (might be in package libiw-dev (Ubuntu) or wireless-tools-devel (Fedora) or libiw-devel (openSUSE)); use --disable-necko-wifi to disable])
fi
fi
if test "$NECKO_WIFI"; then
AC_DEFINE(NECKO_WIFI)
_NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_WIFI"

View File

@ -6053,47 +6053,26 @@ nsContentTypeParser::GetParameter(const char* aParameterName, nsAString& aResult
bool
nsContentUtils::CanAccessNativeAnon()
{
JSContext* cx = nullptr;
sThreadJSContextStack->Peek(&cx);
JSContext* cx = GetCurrentJSContext();
if (!cx) {
return true;
}
JSStackFrame* fp;
nsIPrincipal* principal =
sSecurityManager->GetCxSubjectPrincipalAndFrame(cx, &fp);
NS_ENSURE_TRUE(principal, false);
JSScript *script = nullptr;
if (fp) {
script = JS_GetFrameScript(cx, fp);
} else {
if (!JS_DescribeScriptedCaller(cx, &script, nullptr)) {
// No code at all is running. So we must be arriving here as the result
// of C++ code asking us to do something. Allow access.
return true;
}
}
bool privileged;
if (NS_SUCCEEDED(sSecurityManager->IsSystemPrincipal(principal, &privileged)) &&
privileged) {
// Chrome things are allowed to touch us.
if (IsCallerChrome()) {
return true;
}
// XXX HACK EWW! Allow chrome://global/ access to these things, even
// if they've been cloned into less privileged contexts.
// Allow any code loaded from chrome://global/ to touch us, even if it was
// cloned into a less privileged context.
JSScript *script;
if (!JS_DescribeScriptedCaller(cx, &script, nullptr) || !script) {
return false;
}
static const char prefix[] = "chrome://global/";
const char *filename;
if (script &&
(filename = JS_GetScriptFilename(cx, script)) &&
!strncmp(filename, prefix, ArrayLength(prefix) - 1)) {
return true;
}
// Before we throw, check for UniversalXPConnect.
nsresult rv = sSecurityManager->IsCapabilityEnabled("UniversalXPConnect", &privileged);
if (NS_SUCCEEDED(rv) && privileged) {
if ((filename = JS_GetScriptFilename(cx, script)) &&
!strncmp(filename, prefix, ArrayLength(prefix) - 1))
{
return true;
}

View File

@ -1010,29 +1010,31 @@ public:
PrepareEditorEvent(nsTextEditorState &aState,
nsIContent *aOwnerContent,
const nsAString &aCurrentValue)
: mState(aState)
: mState(aState.asWeakPtr())
, mOwnerContent(aOwnerContent)
, mCurrentValue(aCurrentValue)
{
mState.mValueTransferInProgress = true;
aState.mValueTransferInProgress = true;
}
NS_IMETHOD Run() {
NS_ENSURE_TRUE(mState, NS_ERROR_NULL_POINTER);
// Transfer the saved value to the editor if we have one
const nsAString *value = nullptr;
if (!mCurrentValue.IsEmpty()) {
value = &mCurrentValue;
}
mState.PrepareEditor(value);
mState->PrepareEditor(value);
mState.mValueTransferInProgress = false;
mState->mValueTransferInProgress = false;
return NS_OK;
}
private:
nsTextEditorState &mState;
WeakPtr<nsTextEditorState> mState;
nsCOMPtr<nsIContent> mOwnerContent; // strong reference
nsAutoString mCurrentValue;
};

View File

@ -13,6 +13,7 @@
#include "nsITextControlFrame.h"
#include "nsCycleCollectionParticipant.h"
#include "nsIContent.h"
#include "mozilla/WeakPtr.h"
class nsTextInputListener;
class nsTextControlFrame;
@ -117,7 +118,7 @@ class nsITextControlElement;
class RestoreSelectionState;
class nsTextEditorState {
class nsTextEditorState : public mozilla::SupportsWeakPtr<nsTextEditorState> {
public:
explicit nsTextEditorState(nsITextControlElement* aOwningElement);
~nsTextEditorState();

View File

@ -633,8 +633,6 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand,
NS_ENSURE_SUCCESS(rv, rv);
}
int32_t textType = GET_BIDI_OPTION_TEXTTYPE(GetBidiOptions());
// Look for the parent document. Note that at this point we don't have our
// content viewer set up yet, and therefore do not have a useful
// mParentDocument.
@ -789,13 +787,6 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand,
parserCharset = charset;
parserCharsetSource = charsetSource;
}
// ahmed
// Check if 864 but in Implicit mode !
if ((textType == IBMBIDI_TEXTTYPE_LOGICAL) &&
(charset.LowerCaseEqualsLiteral("ibm864"))) {
charset.AssignLiteral("IBM864i");
}
}
SetDocumentCharacterSetSource(charsetSource);

View File

@ -126,7 +126,7 @@ protected:
};
// Cycle-collection implementation helpers
PR_STATIC_CALLBACK(PLDHashOperator) CompositorTableEntryTraverse(
static PLDHashOperator CompositorTableEntryTraverse(
nsSMILCompositor* aCompositor, void* aArg);
// Returns mDocument's refresh driver, if it's got one.
@ -144,22 +144,22 @@ protected:
void DoSample(bool aSkipUnchangedContainers);
void RewindElements();
PR_STATIC_CALLBACK(PLDHashOperator) RewindNeeded(
static PLDHashOperator RewindNeeded(
TimeContainerPtrKey* aKey, void* aData);
PR_STATIC_CALLBACK(PLDHashOperator) RewindAnimation(
static PLDHashOperator RewindAnimation(
AnimationElementPtrKey* aKey, void* aData);
PR_STATIC_CALLBACK(PLDHashOperator) ClearRewindNeeded(
static PLDHashOperator ClearRewindNeeded(
TimeContainerPtrKey* aKey, void* aData);
void DoMilestoneSamples();
PR_STATIC_CALLBACK(PLDHashOperator) GetNextMilestone(
static PLDHashOperator GetNextMilestone(
TimeContainerPtrKey* aKey, void* aData);
PR_STATIC_CALLBACK(PLDHashOperator) GetMilestoneElements(
static PLDHashOperator GetMilestoneElements(
TimeContainerPtrKey* aKey, void* aData);
PR_STATIC_CALLBACK(PLDHashOperator) SampleTimeContainer(
static PLDHashOperator SampleTimeContainer(
TimeContainerPtrKey* aKey, void* aData);
PR_STATIC_CALLBACK(PLDHashOperator) SampleAnimation(
static PLDHashOperator SampleAnimation(
AnimationElementPtrKey* aKey, void* aData);
static void SampleTimedElement(nsISMILAnimationElement* aElement,
TimeContainerHashtable* aActiveContainers);

View File

@ -83,7 +83,7 @@ public:
void UpdateCachedBaseValue(const nsSMILValue& aBaseValue);
// Static callback methods
PR_STATIC_CALLBACK(PLDHashOperator) DoComposeAttribute(
static PLDHashOperator DoComposeAttribute(
nsSMILCompositor* aCompositor, void *aData);
// The hash key (tuple of element/attributeName/attributeType)

View File

@ -529,7 +529,7 @@ protected:
}
// Hashtable callback methods
PR_STATIC_CALLBACK(PLDHashOperator) NotifyNewIntervalCallback(
static PLDHashOperator NotifyNewIntervalCallback(
TimeValueSpecPtrKey* aKey, void* aData);
//

View File

@ -206,13 +206,9 @@
#include "xp_mcom.h"
#define O_ACCMODE 3 /* Mask for file access modes */
#define EFTYPE 2000
#ifdef __cplusplus
extern "C" {
#endif
PR_BEGIN_EXTERN_C
int mkstemp(const char *path);
#ifdef __cplusplus
}
#endif
PR_END_EXTERN_C
#endif /* MACINTOSH */
#if !defined(_WINDOWS) && !defined(macintosh)
@ -395,9 +391,7 @@ typedef struct {
}
#endif
#ifdef __cplusplus
extern "C" {
#endif
PR_BEGIN_EXTERN_C
extern DB *
dbopen (const char *, int, int, DBTYPE, const void *);
@ -414,8 +408,6 @@ DB *__rec_open (const char *, int, int, const RECNOINFO *, int);
void __dbpanic (DB *dbp);
#endif
#ifdef __cplusplus
}
#endif
PR_END_EXTERN_C
#endif /* !_DB_H_ */

View File

@ -2793,24 +2793,26 @@ nsDocShell::SetDocLoaderParent(nsDocLoader * aParent)
}
SetAllowDNSPrefetch(value);
}
#ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING
// Set the PB flag on the docshell based on the global PB mode for now
nsCOMPtr<nsIPrivateBrowsingService> pbs =
do_GetService(NS_PRIVATE_BROWSING_SERVICE_CONTRACTID);
if (pbs) {
bool inPrivateBrowsing = false;
pbs->GetPrivateBrowsingEnabled(&inPrivateBrowsing);
SetUsePrivateBrowsing(inPrivateBrowsing);
}
#else
nsCOMPtr<nsILoadContext> parentAsLoadContext(do_QueryInterface(parent));
if (parentAsLoadContext &&
NS_SUCCEEDED(parentAsLoadContext->GetUsePrivateBrowsing(&value)))
{
SetUsePrivateBrowsing(value);
}
#ifndef MOZ_PER_WINDOW_PRIVATE_BROWSING
// Belt and suspenders - we want to catch any instances where the flag
// we're propagating doesn't match the global state.
nsCOMPtr<nsIPrivateBrowsingService> pbs =
do_GetService(NS_PRIVATE_BROWSING_SERVICE_CONTRACTID);
if (pbs) {
bool inPrivateBrowsing = false;
pbs->GetPrivateBrowsingEnabled(&inPrivateBrowsing);
NS_ASSERTION(inPrivateBrowsing == mInPrivateBrowsing,
"Privacy status of parent docshell doesn't match global state!");
}
#endif
}
nsCOMPtr<nsIURIContentListener> parentURIListener(do_GetInterface(parent));
if (parentURIListener)
mContentListener->SetParentContentListener(parentURIListener);

View File

@ -197,7 +197,31 @@ let AppsUtils = {
default:
throw new Error("Webapps.jsm: Undetermined app manifest type");
}
}
},
/**
* Determines if an update or a factory reset occured.
*/
isFirstRun: function isFirstRun(aPrefBranch) {
let savedmstone = null;
try {
savedmstone = aPrefBranch.getCharPref("gecko.mstone");
} catch (e) {}
let mstone = Services.appinfo.platformVersion;
let savedBuildID = null;
try {
savedBuildID = aPrefBranch.getCharPref("gecko.buildID");
} catch (e) {}
let buildID = Services.appinfo.platformBuildID;
aPrefBranch.setCharPref("gecko.mstone", mstone);
aPrefBranch.setCharPref("gecko.buildID", buildID);
return ((mstone != savedmstone) || (buildID != savedBuildID));
},
}
/**

View File

@ -53,8 +53,8 @@ function mapSuffixes(aPermName, aSuffixes)
// Permissions Matrix: https://docs.google.com/spreadsheet/ccc?key=0Akyz_Bqjgf5pdENVekxYRjBTX0dCXzItMnRyUU1RQ0E#gid=0
// Permissions that are implicit:
// battery-status, idle, network-information, vibration,
// device-capabilities, webapps-manage, web-activities
// battery-status, network-information, vibration,
// device-capabilities
const PermissionsTable = { "resource-lock": {
app: ALLOW_ACTION,
@ -71,12 +71,12 @@ const PermissionsTable = { "resource-lock": {
privileged: PROMPT_ACTION,
certified: ALLOW_ACTION
},
alarm: {
alarms: {
app: ALLOW_ACTION,
privileged: ALLOW_ACTION,
certified: ALLOW_ACTION
},
"network-tcp": {
"tcp-socket": {
app: DENY_ACTION,
privileged: ALLOW_ACTION,
certified: ALLOW_ACTION
@ -89,11 +89,7 @@ const PermissionsTable = { "resource-lock": {
contacts: {
app: DENY_ACTION,
privileged: PROMPT_ACTION,
certified: ALLOW_ACTION,
access: ["read",
"write",
"create"
]
certified: ALLOW_ACTION
},
"device-storage:apps": {
app: DENY_ACTION,
@ -163,10 +159,7 @@ const PermissionsTable = { "resource-lock": {
settings: {
app: DENY_ACTION,
privileged: DENY_ACTION,
certified: ALLOW_ACTION,
access: ["read",
"write"
],
certified: ALLOW_ACTION
},
permissions: {
app: DENY_ACTION,
@ -183,6 +176,71 @@ const PermissionsTable = { "resource-lock": {
privileged: DENY_ACTION,
certified: ALLOW_ACTION
},
"webapps-manage": {
app: DENY_ACTION,
privileged: DENY_ACTION,
certified: ALLOW_ACTION
},
"backgroundservice": {
app: DENY_ACTION,
privileged: DENY_ACTION,
certified: ALLOW_ACTION
},
"desktop-notification": {
app: DENY_ACTION,
privileged: DENY_ACTION,
certified: ALLOW_ACTION
},
"networkstats-manage": {
app: DENY_ACTION,
privileged: DENY_ACTION,
certified: ALLOW_ACTION
},
"mozBluetooth": {
app: DENY_ACTION,
privileged: DENY_ACTION,
certified: ALLOW_ACTION
},
"wifi-manage": {
app: DENY_ACTION,
privileged: DENY_ACTION,
certified: ALLOW_ACTION
},
"systemXHR": {
app: DENY_ACTION,
privileged: DENY_ACTION,
certified: ALLOW_ACTION
},
"voicemail": {
app: DENY_ACTION,
privileged: DENY_ACTION,
certified: ALLOW_ACTION
},
"deprecated-hwvideo": {
app: DENY_ACTION,
privileged: DENY_ACTION,
certified: ALLOW_ACTION
},
"idle": {
app: DENY_ACTION,
privileged: DENY_ACTION,
certified: ALLOW_ACTION
},
"time": {
app: DENY_ACTION,
privileged: DENY_ACTION,
certified: ALLOW_ACTION
},
"embed-apps": {
app: DENY_ACTION,
privileged: DENY_ACTION,
certified: ALLOW_ACTION
},
"storage": {
app: DENY_ACTION,
privileged: DENY_ACTION,
certified: ALLOW_ACTION
},
};
// Sometimes all permissions (fully expanded) need to be iterated through
@ -213,7 +271,8 @@ function expandPermissions(aPermName, aAccess) {
}
if (!aAccess && PermissionsTable[aPermName].access ||
aAccess && !PermissionsTable[aPermName].access) {
Cu.reportError("PermissionsTable.jsm: expandPermissions: Invalid Manifest");
Cu.reportError("PermissionsTable.jsm: expandPermissions: Invalid Manifest : " +
aPermName + " " + aAccess + "\n");
throw new Error("PermissionsTable.jsm: expandPermissions: Invalid Manifest");
}
if (!PermissionsTable[aPermName].access) {
@ -252,10 +311,13 @@ function expandPermissions(aPermName, aAccess) {
let PermissionsInstaller = {
/**
* Install permissisions or remove deprecated permissions upon re-install
* @param object aData
* The just-installed app configuration
* @param object aApp
* The just-installed app configuration.
The properties used are manifestURL, origin and manifest.
* @param boolean aIsReinstall
* Indicates the app was just re-installed
* @param function aOnError
* A function called if an error occurs
* @returns void
**/
installPermissions: function installPermissions(aApp, aIsReinstall, aOnError) {
@ -292,11 +354,7 @@ let PermissionsInstaller = {
}
// Remove the deprecated permission
// TODO: use PermSettings.remove, see bug 793204
PermSettings.set(AllPossiblePermissions[idx],
"unknown",
aApp.manifestURL,
aApp.origin,
false);
this._setPermission(AllPossiblePermissions[idx], "unknown", aApp);
}
}
}
@ -304,7 +362,7 @@ let PermissionsInstaller = {
let installPermType;
// Check to see if the 'webapp' is app/priv/certified
switch (AppsUtils.getAppManifestStatus(newManifest)) {
switch (AppsUtils.getAppManifestStatus(aApp.manifest)) {
case Ci.nsIPrincipal.APP_STATUS_CERTIFIED:
installPermType = "certified";
break;
@ -316,12 +374,12 @@ let PermissionsInstaller = {
break;
default:
// Cannot determine app type, abort install by throwing an error
throw new Error("Webapps.jsm: Cannot determine app type, install cancelled");
throw new Error("PermissionsInstaller.jsm: Cannot determine app type, install cancelled");
}
for (let permName in newManifest.permissions) {
if (!PermissionsTable[permName]) {
throw new Error("Webapps.jsm: '" + permName + "'" +
throw new Error("PermissionsInstaller.jsm: '" + permName + "'" +
" is not a valid Webapps permission type. Aborting Webapp installation");
return;
}
@ -331,11 +389,7 @@ let PermissionsInstaller = {
for (let idx in perms) {
let perm = PermissionsTable[permName][installPermType];
let permValue = PERM_TO_STRING[perm];
PermSettings.set(perms[idx],
permValue,
aApp.manifestURL,
aApp.origin,
false);
this._setPermission(perms[idx], permValue, aApp);
}
}
}
@ -346,5 +400,30 @@ let PermissionsInstaller = {
aOnError();
}
}
},
/**
* Set a permission value, replacing "storage" if needed.
* @param string aPerm
* The permission name.
* @param string aValue
* The permission value.
* @param object aApp
* The just-installed app configuration.
The properties used are manifestURL, origin and manifest.
* @returns void
**/
_setPermission: function setPermission(aPerm, aValue, aApp) {
dump("XxXxX setting " + aPerm + " to " + aValue + "\n");
if (aPerm != "storage") {
PermSettings.set(aPerm, aValue, aApp.manifestURL, aApp.origin, false);
return;
}
["indexedDB-unlimited", "offline-app", "pin-app"].forEach(
function(aName) {
PermSettings.set(aName, aValue, aApp.manifestURL, aApp.origin, false);
}
);
}
}
}

View File

@ -145,6 +145,21 @@ let DOMApplicationRegistry = {
#endif
},
updatePermissionsForApp: function updatePermissionsForApp(aId) {
// Install the permissions for this app, as if we were updating
// to cleanup the old ones if needed.
this._readManifests([{ id: aId }], (function(aResult) {
let data = aResult[0];
PermissionsInstaller.installPermissions({
manifest: data.manifest,
manifestURL: this.webapps[aId].manifestURL,
origin: this.webapps[aId].origin
}, true, function() {
debug("Error installing permissions for " + aId);
});
}).bind(this));
},
// Implements the core of bug 787439
// 1. load the apps from the current registry.
// 2. if at first run, go through these steps:
@ -154,8 +169,7 @@ let DOMApplicationRegistry = {
// c. for all apps in the new core registry, install them if they are not
// yet in the current registry, and run installPermissions()
loadAndUpdateApps: function loadAndUpdateApps() {
let runUpdate = Services.prefs.getBoolPref("dom.mozApps.runUpdate");
Services.prefs.setBoolPref("dom.mozApps.runUpdate", false);
let runUpdate = AppsUtils.isFirstRun(Services.prefs);
// 1.
this.loadCurrentRegistry((function() {
@ -179,10 +193,14 @@ let DOMApplicationRegistry = {
for (let id in this.webapps) {
if (id in aData || this.webapps[id].removable)
continue;
let localId = this.webapps[id].localId;
delete this.webapps[id];
// XXXX once bug 758269 is ready, revoke perms for this app
// removePermissions(localId);
// Remove the permissions, cookies and private data for this app.
let localId = this.webapps[id].localId;
let permMgr = Cc["@mozilla.org/permissionmanager;1"]
.getService(Ci.nsIPermissionManager);
permMgr.RemovePermissionsForApp(localId);
Services.cookies.removeCookiesForApp(localId, false);
this._clearPrivateData(localId, false);
}
let appDir = FileUtils.getDir("coreAppsDir", ["webapps"], false);
@ -202,19 +220,28 @@ let DOMApplicationRegistry = {
this.webapps[id].removable = false;
}
}
// XXXX once bug 758269 is ready, revoke perms for this app
// let localId = this.webapps[id].localId;
// installPermissions(localId);
this.updatePermissionsForApp(id);
}
this.registerAppsHandlers();
}).bind(this));
} else {
// At first run, set up the permissions for eng builds.
for (let id in this.webapps) {
this.updatePermissionsForApp(id);
}
this.registerAppsHandlers();
}
} else {
this.registerAppsHandlers();
}
#else
if (runUpdate) {
// At first run, set up the permissions for desktop builds.
for (let id in this.webapps) {
this.updatePermissionsForApp(id);
}
}
this.registerAppsHandlers();
#endif
}).bind(this));

View File

@ -138,14 +138,14 @@ nsLocation::GetDocShell()
return docshell;
}
// Try to get the the document corresponding to the given JSStackFrame.
// Try to get the the document corresponding to the given JSScript.
static already_AddRefed<nsIDocument>
GetFrameDocument(JSContext *cx, JSStackFrame *fp)
GetScriptDocument(JSContext *cx, JSScript *script)
{
if (!cx || !fp)
if (!cx || !script)
return nullptr;
JSObject* scope = JS_GetGlobalForFrame(fp);
JSObject* scope = JS_GetGlobalFromScript(script);
if (!scope)
return nullptr;
@ -206,15 +206,6 @@ nsLocation::CheckURL(nsIURI* aURI, nsIDocShellLoadInfo** aLoadInfo)
rv = secMan->CheckLoadURIFromScript(cx, aURI);
NS_ENSURE_SUCCESS(rv, rv);
// Now get the principal to use when loading the URI
// First, get the principal and frame.
JSStackFrame *fp;
nsIPrincipal* principal = secMan->GetCxSubjectPrincipalAndFrame(cx, &fp);
NS_ENSURE_TRUE(principal, NS_ERROR_FAILURE);
nsCOMPtr<nsIURI> principalURI;
principal->GetURI(getter_AddRefs(principalURI));
// Make the load's referrer reflect changes to the document's URI caused by
// push/replaceState, if possible. First, get the document corresponding to
// fp. If the document's original URI (i.e. its URI before
@ -222,11 +213,16 @@ nsLocation::CheckURL(nsIURI* aURI, nsIDocShellLoadInfo** aLoadInfo)
// current URI as the referrer. If they don't match, use the principal's
// URI.
nsCOMPtr<nsIDocument> frameDoc = GetFrameDocument(cx, fp);
nsCOMPtr<nsIURI> docOriginalURI, docCurrentURI;
if (frameDoc) {
docOriginalURI = frameDoc->GetOriginalURI();
docCurrentURI = frameDoc->GetDocumentURI();
JSScript* script = nullptr;
if (!JS_DescribeScriptedCaller(cx, &script, nullptr))
return NS_ERROR_FAILURE;
nsCOMPtr<nsIDocument> doc = GetScriptDocument(cx, script);
nsCOMPtr<nsIURI> docOriginalURI, docCurrentURI, principalURI;
if (doc) {
docOriginalURI = doc->GetOriginalURI();
docCurrentURI = doc->GetDocumentURI();
rv = doc->NodePrincipal()->GetURI(getter_AddRefs(principalURI));
NS_ENSURE_SUCCESS(rv, rv);
}
bool urisEqual = false;
@ -241,7 +237,7 @@ nsLocation::CheckURL(nsIURI* aURI, nsIDocShellLoadInfo** aLoadInfo)
sourceURI = principalURI;
}
owner = do_QueryInterface(principal);
owner = do_QueryInterface(doc ? doc->NodePrincipal() : secMan->GetCxSubjectPrincipal(cx));
}
// Create load info

View File

@ -68,10 +68,15 @@ GetWindowURI(nsIDOMWindow *aWindow)
do_QueryInterface(aWindow);
NS_ENSURE_TRUE(scriptObjPrincipal, NULL);
nsIPrincipal *principal = scriptObjPrincipal->GetPrincipal();
if (principal) {
principal->GetURI(getter_AddRefs(uri));
// GetPrincipal() will print a warning if the window does not have an outer
// window, so check here for an outer window first. This code is
// functionally correct if we leave out the GetOuterWindow() check, but we
// end up printing a lot of warnings during debug mochitests.
if (pWindow->GetOuterWindow()) {
nsIPrincipal* principal = scriptObjPrincipal->GetPrincipal();
if (principal) {
principal->GetURI(getter_AddRefs(uri));
}
}
}

View File

@ -11,6 +11,7 @@
#include "WrapperFactory.h"
#include "xpcprivate.h"
#include "XPCQuickStubs.h"
#include "nsIXPConnect.h"
namespace mozilla {
namespace dom {
@ -629,6 +630,19 @@ HasPropertyOnPrototype(JSContext* cx, JSObject* proxy, DOMProxyHandler* handler,
return !GetPropertyOnPrototype(cx, proxy, id, &found, NULL) || found;
}
bool
WrapCallbackInterface(JSContext *cx, JSObject *scope, nsISupports* callback,
JS::Value* vp)
{
nsCOMPtr<nsIXPConnectWrappedJS> wrappedJS = do_QueryInterface(callback);
MOZ_ASSERT(wrappedJS, "How can we not have an XPCWrappedJS here?");
JSObject* obj;
DebugOnly<nsresult> rv = wrappedJS->GetJSObject(&obj);
MOZ_ASSERT(NS_SUCCEEDED(rv) && obj, "What are we wrapping?");
*vp = JS::ObjectValue(*obj);
return JS_WrapValue(cx, vp);
}
JSObject*
GetXrayExpandoChain(JSObject* obj)
{

View File

@ -725,6 +725,10 @@ WrapObject<JSObject>(JSContext* cx, JSObject* scope, JSObject* p, JS::Value* vp)
return true;
}
bool
WrapCallbackInterface(JSContext *cx, JSObject *scope, nsISupports* callback,
JS::Value* vp);
template<typename T>
static inline JSObject*
WrapNativeParent(JSContext* cx, JSObject* scope, const T& p)

View File

@ -26,7 +26,8 @@
# for which it defaults to false and is not allowed to be set
# at all).
# * concrete - Indicates whether there exist objects with this interface as
# their primary interface (defaults to True).
# their primary interface. Always False for callback interfaces.
# defaults to True otherwise.
# * prefable - Indicates whether this bindings should be disabled if the
# global pref for Web IDL bindings is set to false. This is a
# risk mitigation strategy and it will cause all of the Web IDL
@ -52,8 +53,10 @@
# * wrapperCache: True if this object is a wrapper cache. Objects that are
# not can only be returned from a limited set of methods,
# cannot be prefable, and must ensure that they disallow
# XPConnect wrapping. Always true for worker descriptors.
# Defaults to true.
# XPConnect wrapping. Always false for callback interfaces.
# Always true for worker descriptors for non-callback
# interfaces. Defaults to true for non-worker non-callback
# descriptors.
# * nativeOwnership: Describes how the native object is held. 4 possible
# types: worker object ("worker"), non-refcounted object
# ("owned"), refcounted non-nsISupports object

View File

@ -1770,6 +1770,10 @@ def getJSToNativeConversionTemplate(type, descriptorProvider, failureCode=None,
return CGWrapper(CGGeneric(
failureCode or
'return ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "%s");' % typeName), post="\n")
def onFailureNotCallable(failureCode):
return CGWrapper(CGGeneric(
failureCode or
'return ThrowErrorMessage(cx, MSG_NOT_CALLABLE);'), post="\n")
# A helper function for handling default values. Takes a template
# body and the C++ code to set the default value and wraps the
@ -2393,23 +2397,41 @@ for (uint32_t i = 0; i < length; ++i) {
if type.isCallback():
assert not isEnforceRange and not isClamp
assert not type.treatNonCallableAsNull() or type.nullable()
if isMember:
raise TypeError("Can't handle member callbacks; need to sort out "
"rooting issues")
# XXXbz we're going to assume that callback types are always
# nullable and always have [TreatNonCallableAsNull] for now.
haveCallable = "${val}.isObject() && JS_ObjectIsCallable(cx, &${val}.toObject())"
if defaultValue is not None:
assert(isinstance(defaultValue, IDLNullValue))
haveCallable = "${haveValue} && " + haveCallable
return (
"if (%s) {\n"
" ${declName} = &${val}.toObject();\n"
"} else {\n"
" ${declName} = NULL;\n"
"}" % haveCallable,
CGGeneric("JSObject*"), None, isOptional)
if type.nullable():
declType = CGGeneric("JSObject*")
else:
declType = CGGeneric("NonNull<JSObject>")
if type.treatNonCallableAsNull():
haveCallable = "JS_ObjectIsCallable(cx, &${val}.toObject())"
if not isDefinitelyObject:
haveCallable = "${val}.isObject() && " + haveCallable
if defaultValue is not None:
assert(isinstance(defaultValue, IDLNullValue))
haveCallable = "${haveValue} && " + haveCallable
template = (
"if (%s) {\n"
" ${declName} = &${val}.toObject();\n"
"} else {\n"
" ${declName} = nullptr;\n"
"}" % haveCallable)
else:
template = wrapObjectTemplate(
"if (JS_ObjectIsCallable(cx, &${val}.toObject())) {\n"
" ${declName} = &${val}.toObject();\n"
"} else {\n"
"%s"
"}" % CGIndenter(onFailureNotCallable(failureCode)).define(),
isDefinitelyObject, type,
"${declName} = nullptr",
failureCode)
return (template, declType, None, isOptional)
if type.isAny():
assert not isEnforceRange and not isClamp
@ -2749,16 +2771,13 @@ if (%s.IsNull()) {
type.inner, descriptorProvider,
{
'result' : "%s[i]" % result,
'successCode': ("if (!JS_DefineElement(cx, returnArray, i, tmp,\n"
" NULL, NULL, JSPROP_ENUMERATE)) {\n"
" return false;\n"
"}"),
'successCode': "break;",
'jsvalRef': "tmp",
'jsvalPtr': "&tmp",
'isCreator': isCreator
}
)
innerTemplate = CGIndenter(CGGeneric(innerTemplate)).define()
innerTemplate = CGIndenter(CGGeneric(innerTemplate), 4).define()
return (("""
uint32_t length = %s.Length();
JSObject *returnArray = JS_NewArrayObject(cx, length, NULL);
@ -2767,7 +2786,15 @@ if (!returnArray) {
}
jsval tmp;
for (uint32_t i = 0; i < length; ++i) {
// Control block to let us common up the JS_DefineElement calls when there
// are different ways to succeed at wrapping the object.
do {
%s
} while (0);
if (!JS_DefineElement(cx, returnArray, i, tmp,
nullptr, nullptr, JSPROP_ENUMERATE)) {
return false;
}
}\n""" % (result, innerTemplate)) + setValue("JS::ObjectValue(*returnArray)"), False)
if type.isGeckoInterface():
@ -2778,8 +2805,11 @@ for (uint32_t i = 0; i < length; ++i) {
"}\n")
else:
wrappingCode = ""
if (not descriptor.interface.isExternal() and
not descriptor.interface.isCallback()):
if descriptor.interface.isCallback():
wrap = "WrapCallbackInterface(cx, obj, %s, ${jsvalPtr})" % result
failed = None
elif not descriptor.interface.isExternal():
if descriptor.wrapperCache:
wrapMethod = "WrapNewBindingObject"
else:
@ -2802,14 +2832,15 @@ for (uint32_t i = 0; i < length; ++i) {
descriptor.interface.identifier.name)
# Try old-style wrapping for bindings which might be preffed off.
failed = wrapAndSetPtr("HandleNewBindingWrappingFailure(cx, ${obj}, %s, ${jsvalPtr})" % result)
wrappingCode += wrapAndSetPtr(wrap, failed)
else:
if descriptor.notflattened:
getIID = "&NS_GET_IID(%s), " % descriptor.nativeType
else:
getIID = ""
wrap = "WrapObject(cx, ${obj}, %s, %s${jsvalPtr})" % (result, getIID)
wrappingCode += wrapAndSetPtr(wrap)
failed = None
wrappingCode += wrapAndSetPtr(wrap, failed)
return (wrappingCode, False)
if type.isString():
@ -3849,7 +3880,9 @@ def getUnionAccessorSignatureType(type, descriptorProvider):
return CGGeneric(type.inner.identifier.name)
if type.isCallback():
return CGGeneric("JSObject*")
if type.nullable():
return CGGeneric("JSObject*")
return CGGeneric("JSObject&")
if type.isAny():
return CGGeneric("JS::Value")

View File

@ -187,7 +187,9 @@ class Descriptor(DescriptorProvider):
# If we're concrete, we need to crawl our ancestor interfaces and mark
# them as having a concrete descendant.
self.concrete = desc.get('concrete', not self.interface.isExternal())
self.concrete = (not self.interface.isExternal() and
not self.interface.isCallback() and
desc.get('concrete', True))
if self.concrete:
self.proxy = False
operations = {
@ -263,7 +265,8 @@ class Descriptor(DescriptorProvider):
(self.interface.identifier.name, self.nativeOwnership))
self.customTrace = desc.get('customTrace', self.workers)
self.customFinalize = desc.get('customFinalize', self.workers)
self.wrapperCache = self.workers or desc.get('wrapperCache', True)
self.wrapperCache = (not self.interface.isCallback() and
(self.workers or desc.get('wrapperCache', True)))
if not self.wrapperCache and self.prefable:
raise TypeError("Descriptor for %s is prefable but not wrappercached" %

View File

@ -22,6 +22,7 @@
MSG_DEF(MSG_INVALID_ENUM_VALUE, 2, "Value '{0}' is not a valid value for enumeration {1}.")
MSG_DEF(MSG_MISSING_ARGUMENTS, 1, "Not enough arguments to {0}.")
MSG_DEF(MSG_NOT_OBJECT, 0, "Value not an object.")
MSG_DEF(MSG_NOT_CALLABLE, 0, "Value is not callable.")
MSG_DEF(MSG_DOES_NOT_IMPLEMENT_INTERFACE, 1, "Value does not implement interface {0}.")
MSG_DEF(MSG_NOT_IN_UNION, 1, "Value could not be converted to any of: {0}.")
MSG_DEF(MSG_ILLEGAL_CONSTRUCTOR, 0, "Illegal constructor.")

View File

@ -963,15 +963,8 @@ class IDLType(IDLObject):
assert False # Override me!
def treatNonCallableAsNull(self):
if not (self.nullable() and self.tag() == IDLType.Tags.callback):
raise WebIDLError("Type %s cannot be TreatNonCallableAsNull" % self,
[self.location])
return hasattr(self, "_treatNonCallableAsNull")
def markTreatNonCallableAsNull(self):
assert not self.treatNonCallableAsNull()
self._treatNonCallableAsNull = True
assert self.tag() == IDLType.Tags.callback
return self.nullable() and self.inner._treatNonCallableAsNull
def addExtendedAttributes(self, attrs):
assert len(attrs) == 0
@ -1999,7 +1992,8 @@ class IDLAttribute(IDLInterfaceMember):
def handleExtendedAttribute(self, attr):
identifier = attr.identifier()
if identifier == "TreatNonCallableAsNull":
self.type.markTreatNonCallableAsNull();
raise WebIDLError("TreatNonCallableAsNull cannot be specified on attributes",
[attr.location, self.location])
elif identifier == "SetterInfallible" and self.readonly:
raise WebIDLError("Readonly attributes must not be flagged as "
"[SetterInfallible]",
@ -2114,6 +2108,8 @@ class IDLCallbackType(IDLType, IDLObjectWithScope):
for argument in arguments:
argument.resolve(self)
self._treatNonCallableAsNull = False
def isCallback(self):
return True
@ -2153,6 +2149,16 @@ class IDLCallbackType(IDLType, IDLObjectWithScope):
return (other.isPrimitive() or other.isString() or other.isEnum() or
other.isNonCallbackInterface() or other.isDate())
def addExtendedAttributes(self, attrs):
unhandledAttrs = []
for attr in attrs:
if attr.identifier() == "TreatNonCallableAsNull":
self._treatNonCallableAsNull = True
else:
unhandledAttrs.append(attr)
if len(unhandledAttrs) != 0:
IDLType.addExtendedAttributes(self, unhandledAttrs)
class IDLMethodOverload:
"""
A class that represents a single overload of a WebIDL method. This is not

Some files were not shown because too many files have changed in this diff Show More