Permalink
Browse files

Merge the last PGO-green inbound changeset to m-c.

  • Loading branch information...
rvandermeulen committed Aug 27, 2012
2 parents 83be565 + ffbbdd8 commit 93808ddac6ae754b09d99b52d455ed76d9f78d2f
Showing with 1,365 additions and 778 deletions.
  1. +1 −1 b2g/chrome/content/shell.js
  2. +2 −1 b2g/components/ContentHandler.js
  3. +4 −4 b2g/components/MozKeyboard.js
  4. +76 −5 browser/base/content/browser-social.js
  5. +1 −1 browser/base/content/browser.js
  6. +1 −0 browser/base/content/test/Makefile.in
  7. +15 −4 browser/base/content/test/browser_social_shareButton.js
  8. +9 −0 browser/base/content/test/head.js
  9. BIN browser/base/content/test/social_share_image.png
  10. +19 −0 browser/base/content/test/social_worker.js
  11. +0 −4 browser/locales/en-US/chrome/browser/browser.properties
  12. +2 −9 browser/themes/gnomestripe/browser.css
  13. +0 −3 browser/themes/gnomestripe/jar.mn
  14. BIN browser/themes/gnomestripe/share-button-active.png
  15. BIN browser/themes/gnomestripe/share-button-shared.png
  16. BIN browser/themes/gnomestripe/share-button.png
  17. +2 −9 browser/themes/pinstripe/browser.css
  18. +0 −3 browser/themes/pinstripe/jar.mn
  19. BIN browser/themes/pinstripe/share-button-active.png
  20. BIN browser/themes/pinstripe/share-button-shared.png
  21. BIN browser/themes/pinstripe/share-button.png
  22. +2 −9 browser/themes/winstripe/browser.css
  23. +0 −6 browser/themes/winstripe/jar.mn
  24. BIN browser/themes/winstripe/share-button-active.png
  25. BIN browser/themes/winstripe/share-button-shared.png
  26. BIN browser/themes/winstripe/share-button.png
  27. +3 −2 build/unix/build-clang/build-clang.py
  28. +1 −1 content/base/public/Makefile.in
  29. +3 −3 content/base/public/nsIFrameLoader.idl
  30. +0 −120 content/base/public/nsIFrameMessageManager.idl
  31. +330 −0 content/base/public/nsIMessageManager.idl
  32. +2 −2 content/base/src/messageWakeupService.js
  33. +9 −7 content/base/src/nsCCUncollectableMarker.cpp
  34. +4 −4 content/base/src/nsFrameLoader.cpp
  35. +129 −71 content/base/src/nsFrameMessageManager.cpp
  36. +32 −15 content/base/src/nsFrameMessageManager.h
  37. +3 −2 content/base/src/nsInProcessTabChildGlobal.cpp
  38. +2 −1 content/base/src/nsInProcessTabChildGlobal.h
  39. +7 −4 content/base/test/chrome/file_bug549682.xul
  40. +2 −2 content/base/test/chrome/file_bug616841.xul
  41. +1 −1 content/html/content/src/nsHTMLMediaElement.cpp
  42. +0 −1 docshell/base/nsDocShell.cpp
  43. +9 −10 dom/activities/src/ActivitiesService.jsm
  44. +3 −5 dom/activities/src/ActivityProxy.js
  45. +3 −5 dom/activities/src/ActivityRequestHandler.js
  46. +4 −4 dom/alarm/AlarmService.jsm
  47. +1 −2 dom/apps/src/AppsService.js
  48. +3 −3 dom/apps/src/Webapps.js
  49. +17 −18 dom/apps/src/Webapps.jsm
  50. +3 −3 dom/base/DOMRequestHelper.jsm
  51. +49 −31 dom/base/nsDOMClassInfo.cpp
  52. +5 −0 dom/base/nsDOMClassInfo.h
  53. +2 −0 dom/base/nsDOMClassInfoClasses.h
  54. +7 −4 dom/base/nsGlobalWindow.cpp
  55. +1 −1 dom/base/nsGlobalWindow.h
  56. +33 −34 dom/base/nsJSEnvironment.cpp
  57. +3 −3 dom/contacts/ContactManager.js
  58. +4 −4 dom/contacts/fallback/ContactService.jsm
  59. +1 −1 dom/devicestorage/ipc/test_ipc.html
  60. +2 −2 dom/identity/DOMIdentity.jsm
  61. +2 −2 dom/identity/nsDOMIdentity.js
  62. +1 −1 dom/indexedDB/ipc/test_ipc.html
  63. +3 −3 dom/interfaces/base/nsIDOMChromeWindow.idl
  64. +3 −2 dom/ipc/TabChild.cpp
  65. +2 −1 dom/ipc/TabChild.h
  66. +13 −12 dom/ipc/test.xul
  67. +4 −3 dom/ipc/tests/process_error.xul
  68. +6 −6 dom/messages/SystemMessageInternal.js
  69. +3 −5 dom/messages/SystemMessageManager.js
  70. +4 −4 dom/permission/PermissionPromptHelper.jsm
  71. +4 −4 dom/settings/SettingsChangeNotifier.jsm
  72. +3 −3 dom/settings/SettingsManager.js
  73. +3 −4 dom/system/gonk/RILContentHelper.js
  74. +20 −21 dom/system/gonk/RadioInterfaceLayer.js
  75. +0 −3 dom/tests/mochitest/general/test_interfaces.html
  76. +3 −2 dom/wifi/WifiWorker.js
  77. +6 −5 dom/workers/ScriptLoader.cpp
  78. +6 −7 dom/workers/WorkerPrivate.cpp
  79. +2 −2 extensions/cookie/test/unit_ipc/test_parent.js
  80. +5 −3 extensions/pref/autoconfig/src/nsJSConfigTriggers.cpp
  81. +0 −111 js/src/jsreops.tbl
  82. +6 −7 js/xpconnect/src/XPCComponents.cpp
  83. +2 −1 js/xpconnect/src/XPCJSRuntime.cpp
  84. +1 −0 js/xpconnect/src/xpcprivate.h
  85. +2 −0 js/xpconnect/tests/chrome/Makefile.in
  86. +50 −0 js/xpconnect/tests/chrome/test_bug738244.xul
  87. +50 −0 js/xpconnect/tests/chrome/test_mozMatchesSelector.xul
  88. +2 −0 js/xpconnect/tests/mochitest/Makefile.in
  89. +10 −0 js/xpconnect/tests/mochitest/file_bug738244.html
  90. +1 −0 js/xpconnect/tests/mochitest/file_mozMatchesSelector.html
  91. +8 −0 js/xpconnect/wrappers/WrapperFactory.cpp
  92. +3 −0 js/xpconnect/wrappers/WrapperFactory.h
  93. +232 −75 js/xpconnect/wrappers/XrayWrapper.cpp
  94. +27 −0 js/xpconnect/wrappers/XrayWrapper.h
  95. +1 −1 layout/base/nsPresContext.cpp
  96. +6 −6 layout/build/nsLayoutModule.cpp
  97. +12 −12 layout/ipc/test-ipcbrowser-chrome.js
  98. +1 −1 layout/svg/base/src/nsSVGUtils.cpp
  99. +1 −1 layout/tools/reftest/reftest.js
  100. +2 −1 mobile/xul/chrome/content/CapturePickerUI.js
  101. +12 −11 mobile/xul/chrome/content/WebappsUI.js
  102. +2 −2 mobile/xul/chrome/content/bindings/browser.xml
  103. +1 −1 mobile/xul/components/LoginManager.js
  104. +3 −5 netwerk/protocol/app/AppProtocolHandler.js
  105. +7 −7 testing/marionette/marionette-actors.js
  106. +2 −2 testing/mochitest/specialpowers/components/SpecialPowersObserver.js
  107. +1 −1 toolkit/components/contentprefs/nsContentPrefService.js
  108. +2 −2 toolkit/components/contentprefs/tests/unit_ipc/test_contentPrefs_parentipc.js
  109. +2 −2 toolkit/components/satchel/nsFormHistory.js
  110. +2 −2 toolkit/mozapps/extensions/ChromeManifestParser.jsm
  111. +2 −2 toolkit/mozapps/extensions/XPIProvider.jsm
  112. +1 −1 toolkit/mozapps/extensions/addonManager.js
  113. +3 −3 toolkit/themes/pinstripe/global/media/videocontrols.css
  114. BIN toolkit/themes/pinstripe/global/media/volumeThumb.png
  115. +3 −3 toolkit/themes/winstripe/global/media/videocontrols.css
  116. BIN toolkit/themes/winstripe/global/media/volumeThumb.png
@@ -49,7 +49,7 @@ XPCOMUtils.defineLazyGetter(this, 'DebuggerServer', function() {
XPCOMUtils.defineLazyGetter(this, "ppmm", function() {
return Cc["@mozilla.org/parentprocessmessagemanager;1"]
- .getService(Ci.nsIFrameMessageManager);
+ .getService(Ci.nsIMessageListenerManager);
});
function getContentWindow() {
@@ -14,7 +14,8 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
XPCOMUtils.defineLazyGetter(this, "cpmm", function() {
- return Cc["@mozilla.org/childprocessmessagemanager;1"].getService(Ci.nsIFrameMessageManager);
+ return Cc["@mozilla.org/childprocessmessagemanager;1"]
+ .getService(Ci.nsIMessageSender);
});
function log(aMsg) {
@@ -14,7 +14,7 @@ Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/ObjectWrapper.jsm");
const messageManager = Cc["@mozilla.org/globalmessagemanager;1"]
- .getService(Ci.nsIChromeFrameMessageManager);
+ .getService(Ci.nsIMessageBroadcaster);
// -----------------------------------------------------------------------
@@ -70,19 +70,19 @@ MozKeyboard.prototype = {
},
setSelectedOption: function mozKeyboardSetSelectedOption(index) {
- messageManager.sendAsyncMessage("Forms:Select:Choice", {
+ messageManager.broadcastAsyncMessage("Forms:Select:Choice", {
"index": index
});
},
setValue: function mozKeyboardSetValue(value) {
- messageManager.sendAsyncMessage("Forms:Input:Value", {
+ messageManager.broadcastAsyncMessage("Forms:Input:Value", {
"value": value
});
},
setSelectedOptions: function mozKeyboardSetSelectedOptions(indexes) {
- messageManager.sendAsyncMessage("Forms:Select:Choice", {
+ messageManager.broadcastAsyncMessage("Forms:Select:Choice", {
"indexes": indexes || []
});
},
@@ -293,6 +293,12 @@ let SocialFlyout = {
}
let SocialShareButton = {
+ // promptImages and promptMessages being null means we are yet to get the
+ // message back from the provider with the images and icons (or that we got
+ // the response but determined it was invalid.)
+ promptImages: null,
+ promptMessages: null,
+
// Called once, after window load, when the Social.provider object is initialized
init: function SSB_init() {
this.updateButtonHiddenState();
@@ -311,6 +317,61 @@ let SocialShareButton = {
} else {
profileRow.hidden = true;
}
+ // XXX - this shouldn't be done as part of updateProfileInfo, but instead
+ // whenever we notice the provider has changed - but the concept of
+ // "provider changed" will only exist once bug 774520 lands.
+ this.promptImages = null;
+ this.promptMessages = null;
+ // get the recommend-prompt info.
+ let port = Social.provider._getWorkerPort();
+ if (port) {
+ port.onmessage = function(evt) {
+ if (evt.data.topic == "social.user-recommend-prompt-response") {
+ port.close();
+ this.acceptRecommendInfo(evt.data.data);
+ this.updateButtonHiddenState();
+ this.updateShareState();
+ }
+ }.bind(this);
+ port.postMessage({topic: "social.user-recommend-prompt"});
+ }
+ },
+
+ acceptRecommendInfo: function SSB_acceptRecommendInfo(data) {
+ // Accept *and validate* the user-recommend-prompt-response message.
+ let promptImages = {};
+ let promptMessages = {};
+ function reportError(reason) {
+ Cu.reportError("Invalid recommend data from provider: " + reason + ": sharing is disabled for this provider");
+ return false;
+ }
+ if (!data ||
+ !data.images || typeof data.images != "object" ||
+ !data.messages || typeof data.messages != "object") {
+ return reportError("data is missing valid 'images' or 'messages' elements");
+ }
+ for (let sub of ["share", "unshare"]) {
+ let url = data.images[sub];
+ if (!url || typeof url != "string" || url.length == 0) {
+ return reportError('images["' + sub + '"] is missing or not a non-empty string');
+ }
+ // resolve potentially relative URLs then check the scheme is acceptable.
+ url = Services.io.newURI(Social.provider.origin, null, null).resolve(url);
+ let uri = Services.io.newURI(url, null, null);
+ if (!uri.schemeIs("http") && !uri.schemeIs("https") && !uri.schemeIs("data")) {
+ return reportError('images["' + sub + '"] does not have a valid scheme');
+ }
+ promptImages[sub] = url;
+ }
+ for (let sub of ["shareTooltip", "unshareTooltip", "sharedLabel", "unsharedLabel"]) {
+ if (typeof data.messages[sub] != "string" || data.messages[sub].length == 0) {
+ return reportError('messages["' + sub + '"] is not a valid string');
+ }
+ promptMessages[sub] = data.messages[sub];
+ }
+ this.promptImages = promptImages;
+ this.promptMessages = promptMessages;
+ return true;
},
get shareButton() {
@@ -327,7 +388,7 @@ let SocialShareButton = {
updateButtonHiddenState: function SSB_updateButtonHiddenState() {
let shareButton = this.shareButton;
if (shareButton)
- shareButton.hidden = !Social.uiVisible;
+ shareButton.hidden = !Social.uiVisible || this.promptImages == null;
},
onClick: function SSB_onClick(aEvent) {
@@ -370,23 +431,33 @@ let SocialShareButton = {
// Provide a11y-friendly notification of share.
let status = document.getElementById("share-button-status");
if (status) {
+ // XXX - this should also be capable of reflecting that the page was
+ // unshared (ie, it needs to manage three-states: (1) nothing done, (2)
+ // shared, (3) shared then unshared)
+ // Note that we *do* have an appropriate string from the provider for
+ // this (promptMessages['unsharedLabel'] but currently lack a way of
+ // tracking this state)
let statusString = currentPageShared ?
- gNavigatorBundle.getString("social.pageShared.label") : "";
+ this.promptMessages['sharedLabel'] : "";
status.setAttribute("value", statusString);
}
// Update the share button, if present
let shareButton = this.shareButton;
- if (!shareButton)
+ if (!shareButton || shareButton.hidden)
return;
+ let imageURL;
if (currentPageShared) {
shareButton.setAttribute("shared", "true");
- shareButton.setAttribute("tooltiptext", gNavigatorBundle.getString("social.shareButton.sharedtooltip"));
+ shareButton.setAttribute("tooltiptext", this.promptMessages['unshareTooltip']);
+ imageURL = this.promptImages["unshare"]
} else {
shareButton.removeAttribute("shared");
- shareButton.setAttribute("tooltiptext", gNavigatorBundle.getString("social.shareButton.tooltip"));
+ shareButton.setAttribute("tooltiptext", this.promptMessages['shareTooltip']);
+ imageURL = this.promptImages["share"]
}
+ shareButton.style.backgroundImage = 'url("' + encodeURI(imageURL) + '")';
}
};
@@ -360,7 +360,7 @@ const gSessionHistoryObserver = {
fwdCommand.setAttribute("disabled", "true");
// Hide session restore button on about:home
- window.messageManager.sendAsyncMessage("Browser:HideSessionRestoreButton");
+ window.messageManager.broadcastAsyncMessage("Browser:HideSessionRestoreButton");
if (gURLBar) {
// Clear undo history of the URL bar
@@ -268,6 +268,7 @@ _BROWSER_FILES = \
browser_social_isVisible.js \
browser_social_chatwindow.js \
social_panel.html \
+ social_share_image.png \
social_sidebar.html \
social_chat.html \
social_flyout.html \
@@ -48,11 +48,12 @@ function testInitial(finishcb) {
let okButton = document.getElementById("editSharePopupOkButton");
let undoButton = document.getElementById("editSharePopupUndoButton");
+ let shareStatusLabel = document.getElementById("share-button-status");
// ensure the worker initialization and handshakes are all done and we
- // have a profile.
- waitForCondition(function() Social.provider.profile, function() {
- is(shareButton.hidden, false, "share button should be visible");
+ // have a profile and the worker has responsed to the recommend-prompt msg.
+ waitForCondition(function() Social.provider.profile && SocialShareButton.promptImages != null, function() {
+ is(shareButton.hasAttribute("shared"), false, "Share button should not have 'shared' attribute before share button is clicked");
// check dom values
let profile = Social.provider.profile;
let portrait = document.getElementById("socialUserPortrait").getAttribute("src");
@@ -61,14 +62,24 @@ function testInitial(finishcb) {
is(displayName.label, profile.displayName, "display name is set");
ok(!document.getElementById("editSharePopupHeader").hidden, "user profile is visible");
+ // Check the strings from our worker actually ended up on the button.
+ is(shareButton.getAttribute("tooltiptext"), "Share this page", "check tooltip text is correct");
+ is(shareStatusLabel.getAttribute("value"), "", "check status label text is blank");
+ // Check the relative URL was resolved correctly (note this image has offsets of zero...)
+ is(shareButton.style.backgroundImage, 'url("https://example.com/browser/browser/base/content/test/social_share_image.png")', "check image url is correct");
+
// Test clicking the share button
shareButton.addEventListener("click", function listener() {
shareButton.removeEventListener("click", listener);
is(shareButton.hasAttribute("shared"), true, "Share button should have 'shared' attribute after share button is clicked");
+ is(shareButton.getAttribute("tooltiptext"), "Unshare this page", "check tooltip text is correct");
+ is(shareStatusLabel.getAttribute("value"), "This page has been shared", "check status label text is correct");
+ // Check the URL and offsets were applied correctly
+ is(shareButton.style.backgroundImage, 'url("https://example.com/browser/browser/base/content/test/social_share_image.png")', "check image url is correct");
executeSoon(testSecondClick.bind(window, testPopupOKButton));
});
EventUtils.synthesizeMouseAtCenter(shareButton, {});
- }, "provider didn't provide a profile");
+ }, "provider didn't provide user-recommend-prompt response");
}
function testSecondClick(nextTest) {
@@ -134,6 +134,15 @@ function runSocialTestWithProvider(manifest, callback) {
Services.prefs.setBoolPref("social.enabled", true);
registerCleanupFunction(function () {
+ // if one test happens to fail, it is likely finishSocialTest will not
+ // be called, causing most future social tests to also fail as they
+ // attempt to add a provider which already exists - so work
+ // around that by also attempting to remove the test provider.
+ try {
+ SocialService.removeProvider(provider.origin, finish);
+ } catch (ex) {
+ ;
+ }
Social.provider = oldProvider;
Services.prefs.clearUserPref("social.enabled");
});
Binary file not shown.
@@ -91,6 +91,25 @@ onconnect = function(e) {
case "test-isVisible-response":
testPort.postMessage({topic: "got-isVisible-response", result: event.data.result});
break;
+ case "social.user-recommend-prompt":
+ port.postMessage({
+ topic: "social.user-recommend-prompt-response",
+ data: {
+ images: {
+ // this one is relative to test we handle relative ones.
+ share: "browser/browser/base/content/test/social_share_image.png",
+ // absolute to check we handle them too.
+ unshare: "https://example.com/browser/browser/base/content/test/social_share_image.png"
+ },
+ messages: {
+ shareTooltip: "Share this page",
+ unshareTooltip: "Unshare this page",
+ sharedLabel: "This page has been shared",
+ unsharedLabel: "This page is no longer shared",
+ }
+ }
+ });
+ break;
}
}
}
@@ -372,10 +372,6 @@ fullscreen.entered=%S is now fullscreen.
# LOCALIZATION NOTE (fullscreen.rememberDecision): displayed when we enter HTML5 fullscreen mode, %S is the domain name of the focused website (e.g. mozilla.com).
fullscreen.rememberDecision=Remember decision for %S
-social.shareButton.tooltip=Share this
-social.shareButton.sharedtooltip=You shared this
-social.pageShared.label=Page shared
-
# LOCALIZATION NOTE (social.toggle.label): %1$S is the name of the social provider, %2$S is brandShortName (e.g. Firefox)
social.toggle.label=%1$S for %2$S
social.toggle.accesskey=f
@@ -1373,15 +1373,8 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
/* social recommending panel */
#share-button {
- list-style-image: url(chrome://browser/skin/share-button.png);
-}
-
-#share-button:not([shared]):not([disabled]):hover {
- list-style-image: url(chrome://browser/skin/share-button-active.png);
-}
-
-#share-button[shared] {
- list-style-image: url(chrome://browser/skin/share-button-shared.png);
+ width: 16px;
+ height: 16px;
}
#socialUserPortrait {
@@ -39,9 +39,6 @@ browser.jar:
skin/classic/browser/Secure.png
skin/classic/browser/Security-broken.png
skin/classic/browser/setDesktopBackground.css
- skin/classic/browser/share-button.png
- skin/classic/browser/share-button-active.png
- skin/classic/browser/share-button-shared.png
skin/classic/browser/Toolbar.png
skin/classic/browser/Toolbar-small.png
skin/classic/browser/urlbar-arrow.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1245,15 +1245,8 @@ window[tabsontop="false"] richlistitem[type~="action"][actiontype="switchtab"][s
/* social recommending panel */
#share-button {
- list-style-image: url(chrome://browser/skin/share-button.png);
-}
-
-#share-button:not([shared]):not([disabled]):hover {
- list-style-image: url(chrome://browser/skin/share-button-active.png);
-}
-
-#share-button[shared] {
- list-style-image: url(chrome://browser/skin/share-button-shared.png);
+ width: 16px;
+ height: 16px;
}
#socialUserPortrait {
@@ -64,9 +64,6 @@ browser.jar:
skin/classic/browser/newtab/controls.png (newtab/controls.png)
skin/classic/browser/newtab/noise.png (newtab/noise.png)
skin/classic/browser/setDesktopBackground.css
- skin/classic/browser/share-button.png
- skin/classic/browser/share-button-active.png
- skin/classic/browser/share-button-shared.png
skin/classic/browser/monitor.png
skin/classic/browser/monitor_16-10.png
skin/classic/browser/places/allBookmarks.png (places/allBookmarks.png)
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1636,15 +1636,8 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
/* social recommending panel */
#share-button {
- list-style-image: url(chrome://browser/skin/share-button.png);
-}
-
-#share-button:not([shared]):not([disabled]):hover {
- list-style-image: url(chrome://browser/skin/share-button-active.png);
-}
-
-#share-button[shared] {
- list-style-image: url(chrome://browser/skin/share-button-shared.png);
+ width: 16px;
+ height: 16px;
}
#socialUserPortrait {
@@ -50,9 +50,6 @@ browser.jar:
skin/classic/browser/searchbar.css (searchbar.css)
skin/classic/browser/searchbar-dropdown-arrow.png
skin/classic/browser/setDesktopBackground.css
- skin/classic/browser/share-button.png
- skin/classic/browser/share-button-active.png
- skin/classic/browser/share-button-shared.png
skin/classic/browser/menu-back.png (menu-back.png)
skin/classic/browser/menu-forward.png (menu-forward.png)
skin/classic/browser/monitor.png
@@ -254,9 +251,6 @@ browser.jar:
skin/classic/aero/browser/searchbar.css (searchbar.css)
skin/classic/aero/browser/searchbar-dropdown-arrow.png (searchbar-dropdown-arrow-aero.png)
skin/classic/aero/browser/setDesktopBackground.css
- skin/classic/aero/browser/share-button.png
- skin/classic/aero/browser/share-button-active.png
- skin/classic/aero/browser/share-button-shared.png
skin/classic/aero/browser/menu-back.png (menu-back-aero.png)
skin/classic/aero/browser/menu-forward.png (menu-forward-aero.png)
skin/classic/aero/browser/monitor.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.

0 comments on commit 93808dd

Please sign in to comment.