Skip to content

Commit

Permalink
Merge the last PGO-green inbound changeset to m-c.
Browse files Browse the repository at this point in the history
  • Loading branch information
rvandermeulen committed Sep 22, 2012
2 parents b515773 + 8fff885 commit a740bd1
Show file tree
Hide file tree
Showing 270 changed files with 28,640 additions and 1,445 deletions.
41 changes: 40 additions & 1 deletion b2g/chrome/content/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,45 @@ SettingsListener.observe('language.current', 'en-US', function(value) {
});
})();

//=================== DeviceInfo ====================
Components.utils.import('resource://gre/modules/XPCOMUtils.jsm');
Components.utils.import('resource://gre/modules/ctypes.jsm');
(function DeviceInfoToSettings() {
XPCOMUtils.defineLazyServiceGetter(this, 'gSettingsService',
'@mozilla.org/settingsService;1',
'nsISettingsService');
let lock = gSettingsService.createLock();
//MOZ_B2G_VERSION is set in b2g/confvars.sh, and is outputed as a #define value
//from configure.in, defaults to 1.0.0 if this value is not exist
#filter attemptSubstitution
let os_version = '@MOZ_B2G_VERSION@';
#unfilter attemptSubstitution
lock.set('deviceinfo.os', os_version, null, null);

//Get the hardware info from android properties
var hardware_version = null;
try {
let cutils = ctypes.open('libcutils.so');
let cbuf = ctypes.char.array(128)();
let c_property_get = cutils.declare('property_get', ctypes.default_abi,
ctypes.int, // return value: length
ctypes.char.ptr, // key
ctypes.char.ptr, // value
ctypes.char.ptr); // default
let property_get = function (key, defaultValue) {
if (defaultValue === undefined) {
defaultValue = null;
}
c_property_get(key, cbuf, defaultValue);
return cbuf.readString();
}
hardware_version = property_get('ro.hardware');
cutils.close();
} catch(e) {
//Error
}
lock.set('deviceinfo.hardware', hardware_version, null, null);
})();

// =================== Debugger ====================
SettingsListener.observe('devtools.debugger.remote-enabled', false, function(enabled) {
Expand Down Expand Up @@ -110,4 +149,4 @@ SettingsListener.observe('debug.dev-mode', false, function(value) {
// =================== Privacy ====================
SettingsListener.observe('privacy.donottrackheader.enabled', false, function(value) {
Services.prefs.setBoolPref('privacy.donottrackheader.enabled', value);
});
});
3 changes: 3 additions & 0 deletions b2g/chrome/content/shell.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ Cu.import('resource://gre/modules/XPCOMUtils.jsm');
Cu.import('resource://gre/modules/Services.jsm');
Cu.import('resource://gre/modules/ContactService.jsm');
Cu.import('resource://gre/modules/SettingsChangeNotifier.jsm');
#ifdef MOZ_B2G_FM
Cu.import('resource://gre/modules/DOMFMRadioParent.jsm');
#endif
Cu.import('resource://gre/modules/AlarmService.jsm');
Cu.import('resource://gre/modules/ActivitiesService.jsm');
Cu.import('resource://gre/modules/PermissionPromptHelper.jsm');
Expand Down
2 changes: 1 addition & 1 deletion b2g/chrome/jar.mn
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ chrome.jar:
content/arrow.svg (content/arrow.svg)
content/dbg-browser-actors.js (content/dbg-browser-actors.js)
content/forms.js (content/forms.js)
content/settings.js (content/settings.js)
* content/settings.js (content/settings.js)
* content/shell.xul (content/shell.xul)
* content/shell.js (content/shell.js)
#ifndef ANDROID
Expand Down
2 changes: 2 additions & 0 deletions b2g/confvars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ MOZ_APP_VENDOR=Mozilla
MOZ_APP_VERSION=18.0a1
MOZ_APP_UA_NAME=Firefox

MOZ_B2G_VERSION=1.0.0

MOZ_BRANDING_DIRECTORY=b2g/branding/unofficial
MOZ_OFFICIAL_BRANDING_DIRECTORY=b2g/branding/official
# MOZ_APP_DISPLAYNAME is set by branding/configure.sh
Expand Down
7 changes: 7 additions & 0 deletions b2g/installer/package-manifest.in
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@
@BINPATH@/components/dom_system_gonk.xpt
@BINPATH@/components/dom_icc.xpt
#endif
#ifdef MOZ_B2G_FM
@BINPATH@/components/dom_fm.xpt
#endif
@BINPATH@/components/dom_battery.xpt
#ifdef MOZ_B2G_BT
@BINPATH@/components/dom_bluetooth.xpt
Expand Down Expand Up @@ -455,6 +458,10 @@
@BINPATH@/components/DOMWifiManager.js
@BINPATH@/components/DOMWifiManager.manifest
#endif
#ifdef MOZ_B2G_FM
@BINPATH@/components/DOMFMRadioChild.js
@BINPATH@/components/DOMFMRadio.manifest
#endif
#ifdef XP_MACOSX
@BINPATH@/components/libalerts.dylib
#endif
Expand Down
13 changes: 12 additions & 1 deletion browser/base/content/browser-social.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,18 @@ let SocialFlyout = {

sizeSocialPanelToContent(iframe);
let anchor = document.getElementById("social-sidebar-browser");
panel.openPopup(anchor, "start_before", 0, yOffset, false, false);
if (panel.state == "open") {
// this is painful - there is no way to say "move to a new anchor offset",
// only "move to new screen pos". So we remember the last yOffset,
// calculate the adjustment needed to the new yOffset, then calc the
// screen Y position.
let yAdjust = yOffset - this.yOffset;
let box = panel.boxObject;
panel.moveTo(box.screenX, box.screenY + yAdjust);
} else {
panel.openPopup(anchor, "start_before", 0, yOffset, false, false);
}
this.yOffset = yOffset;
}
}

Expand Down
1 change: 1 addition & 0 deletions build/virtualenv/packages.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ blessings.pth:python/blessings
mozbuild.pth:python/mozbuild
optional:setup.py:python/psutil:build_ext:--inplace
optional:psutil.pth:python/psutil
which.pth:python/which
mozilla.pth:build
mozilla.pth:config
copy:build/buildconfig.py
18 changes: 18 additions & 0 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -2082,6 +2082,7 @@ ia64*-hpux*)
_PLATFORM_DEFAULT_TOOLKIT=cairo-gonk
MOZ_B2G_RIL=1
MOZ_B2G_BT=1
MOZ_B2G_FM=1
else
_PLATFORM_DEFAULT_TOOLKIT=cairo-android
MOZ_LINKER=1
Expand Down Expand Up @@ -2981,6 +2982,8 @@ dnl NB - later gcc versions require -mmmx for this header to be successfully
dnl included (or another option which implies it, such as -march=pentium-mmx)
MOZ_CHECK_HEADERS(mmintrin.h)

MOZ_CHECK_HEADERS(sys/types.h netinet/in.h byteswap.h)

dnl Check whether the compiler supports the new-style C++ standard
dnl library headers (i.e. <new>) or needs the old "new.h"
AC_LANG_CPLUSPLUS
Expand Down Expand Up @@ -4189,6 +4192,7 @@ MOZ_MEDIA=
MOZ_OPUS=1
MOZ_WEBM=1
MOZ_WEBRTC=1
MOZ_SRTP=
MOZ_WEBRTC_SIGNALING=
MOZ_MEDIA_PLUGINS=
MOZ_MEDIA_NAVIGATOR=
Expand Down Expand Up @@ -5191,9 +5195,12 @@ if test -n "$MOZ_WEBRTC"; then
MOZ_VP8=1
MOZ_VP8_ENCODER=1
MOZ_VP8_ERROR_CONCEALMENT=1
MOZ_SRTP=1
AC_DEFINE(MOZ_SRTP)
fi

AC_SUBST(MOZ_WEBRTC)
AC_SUBST(MOZ_SRTP)

case "$target_cpu" in
arm*)
Expand Down Expand Up @@ -7314,6 +7321,14 @@ if test -n "$MOZ_B2G_RIL"; then
fi
AC_SUBST(MOZ_B2G_RIL)

dnl ========================================================
dnl = Enable Radio FM for B2G (Gonk usually)
dnl ========================================================
if test -n "$MOZ_B2G_FM"; then
AC_DEFINE(MOZ_B2G_FM)
fi
AC_SUBST(MOZ_B2G_FM)

dnl ========================================================
dnl = Enable Bluetooth Interface for B2G (Gonk usually)
dnl ========================================================
Expand Down Expand Up @@ -8353,6 +8368,9 @@ else
MOZ_APP_MAXVERSION=$MOZ_APP_VERSION
fi

MOZ_B2G_VERSION=${MOZ_B2G_VERSION:-"1.0.0"}
AC_DEFINE_UNQUOTED(MOZ_B2G_VERSION,"$MOZ_B2G_VERSION")

AC_SUBST(MOZ_APP_NAME)
AC_SUBST(MOZ_APP_DISPLAYNAME)
AC_SUBST(MOZ_APP_BASENAME)
Expand Down
14 changes: 1 addition & 13 deletions content/base/src/FragmentOrElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -747,19 +747,7 @@ FragmentOrElement::HasAttributes(bool* aReturn)
NS_IMETHODIMP
FragmentOrElement::GetAttributes(nsIDOMNamedNodeMap** aAttributes)
{
if (!IsElement()) {
*aAttributes = nullptr;
return NS_OK;
}

nsDOMSlots *slots = DOMSlots();

if (!slots->mAttributeMap) {
slots->mAttributeMap = new nsDOMAttributeMap(this->AsElement());
}

NS_ADDREF(*aAttributes = slots->mAttributeMap);

*aAttributes = nullptr;
return NS_OK;
}

Expand Down
14 changes: 14 additions & 0 deletions content/base/src/nsGenericElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1687,6 +1687,20 @@ nsGenericElement::GetExistingAttrNameFromQName(const nsAString& aStr) const
return nodeInfo;
}

NS_IMETHODIMP
nsGenericElement::GetAttributes(nsIDOMNamedNodeMap** aAttributes)
{
nsDOMSlots *slots = DOMSlots();

if (!slots->mAttributeMap) {
slots->mAttributeMap = new nsDOMAttributeMap(this);
}

NS_ADDREF(*aAttributes = slots->mAttributeMap);

return NS_OK;
}

// static
bool
nsGenericElement::ShouldBlur(nsIContent *aContent)
Expand Down
3 changes: 3 additions & 0 deletions content/base/src/nsGenericElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ class nsGenericElement : public mozilla::dom::Element
{
return SetAttr(aNameSpaceID, aName, nullptr, aValue, aNotify);
}

NS_IMETHOD GetAttributes(nsIDOMNamedNodeMap** aAttributes);

/**
* Helper for SetAttr/SetParsedAttr. This method will return true if aNotify
* is true or there are mutation listeners that must be triggered, the
Expand Down
2 changes: 2 additions & 0 deletions content/base/src/nsGkAtomList.h
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,8 @@ GK_ATOM(onshow, "onshow")
GK_ATOM(onstatechange, "onstatechange")
GK_ATOM(onstatuschanged, "onstatuschanged")
GK_ATOM(onstkcommand, "onstkcommand")
GK_ATOM(onantennastatechange, "onantennastatechange")
GK_ATOM(onseekcomplete, "onseekcomplete")
GK_ATOM(onstksessionend, "onstksessionend")
GK_ATOM(onsubmit, "onsubmit")
GK_ATOM(onsuccess, "onsuccess")
Expand Down
2 changes: 1 addition & 1 deletion content/canvas/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ include $(DEPTH)/config/autoconf.mk

PARALLEL_DIRS = public src

TEST_DIRS += test
TOOLS_DIRS += test

include $(topsrcdir)/config/rules.mk

2 changes: 2 additions & 0 deletions content/canvas/src/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ EXPORTS = \
CustomQS_Canvas.h \
CustomQS_Canvas2D.h \
WebGLContext.h \
WebGLElementArrayCache.h \
$(NULL)

EXPORTS_NAMESPACES = mozilla/dom
Expand Down Expand Up @@ -52,6 +53,7 @@ CPPSRCS += \
WebGLTexelConversions.cpp \
WebGLExtensionCompressedTextureS3TC.cpp \
WebGLExtensionDepthTexture.cpp \
WebGLElementArrayCache.cpp \
$(NULL)

DEFINES += -DUSE_ANGLE
Expand Down
12 changes: 2 additions & 10 deletions content/canvas/src/WebGLContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,8 @@ void WebGLContext::LoseOldestWebGLContextIfLimitExceeded()
const size_t kMaxWebGLContextsPerPrincipal = 2;
const size_t kMaxWebGLContexts = 4;
#else
const size_t kMaxWebGLContextsPerPrincipal = 8;
const size_t kMaxWebGLContexts = 16;
const size_t kMaxWebGLContextsPerPrincipal = 16;
const size_t kMaxWebGLContexts = 32;
#endif
MOZ_ASSERT(kMaxWebGLContextsPerPrincipal < kMaxWebGLContexts);

Expand Down Expand Up @@ -1012,14 +1012,6 @@ WebGLContext::GetExtension(const nsAString& aName)
if (IsExtensionSupported(EXT_texture_filter_anisotropic))
ext = EXT_texture_filter_anisotropic;
}
else if (aName.Equals(NS_LITERAL_STRING("MOZ_EXT_texture_filter_anisotropic"),
nsCaseInsensitiveStringComparator()))
{
GenerateWarning("MOZ_EXT_texture_filter_anisotropic has been renamed to EXT_texture_filter_anisotropic. "
"Support for the MOZ_-prefixed string will be removed very soon.");
if (IsExtensionSupported(EXT_texture_filter_anisotropic))
ext = EXT_texture_filter_anisotropic;
}
else if (aName.Equals(NS_LITERAL_STRING("MOZ_WEBGL_lose_context"),
nsCaseInsensitiveStringComparator()))
{
Expand Down
Loading

0 comments on commit a740bd1

Please sign in to comment.