Merge mozilla-central to mozilla-inbound
authorEd Morley <bmo@edmorley.co.uk>
Sat, 18 Feb 2012 00:36:09 +0000
changeset 87145 e423d872f94ff6cf4635d789dacebf44076e5b35
parent 87144 4ab82ee636d69eacf62a890562a05e764536e7e2 (current diff)
parent 87129 e001b5eda61831fd2e3fe5b1dde813fc25ab7243 (diff)
child 87146 7c5b5e3cedddd389f790171a9bccc1888a0d9333
push id22083
push userbmo@edmorley.co.uk
push dateSat, 18 Feb 2012 11:19:19 +0000
treeherdermozilla-central@20478b673212 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone13.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge mozilla-central to mozilla-inbound
dom/bluetooth/BluetoothAdapter.cpp
dom/bluetooth/BluetoothAdapter.h
dom/bluetooth/BluetoothCommon.h
dom/bluetooth/Makefile.in
dom/bluetooth/nsIDOMBluetoothAdapter.idl
dom/bluetooth/nsIDOMNavigatorBluetooth.idl
security/patches/bug-717906-lowhash
--- a/b2g/installer/package-manifest.in
+++ b/b2g/installer/package-manifest.in
@@ -146,19 +146,16 @@
 @BINPATH@/components/dom.xpt
 @BINPATH@/components/dom_base.xpt
 #ifdef MOZ_B2G_RIL
 @BINPATH@/components/dom_telephony.xpt
 @BINPATH@/components/dom_wifi.xpt
 @BINPATH@/components/dom_system_b2g.xpt
 #endif
 @BINPATH@/components/dom_battery.xpt
-#ifdef MOZ_B2G_BT
-@BINPATH@/components/dom_bluetooth.xpt
-#endif
 @BINPATH@/components/dom_canvas.xpt
 @BINPATH@/components/dom_core.xpt
 @BINPATH@/components/dom_css.xpt
 @BINPATH@/components/dom_events.xpt
 @BINPATH@/components/dom_geolocation.xpt
 @BINPATH@/components/dom_network.xpt
 @BINPATH@/components/dom_notification.xpt
 @BINPATH@/components/dom_html.xpt
copy from browser/config/mozconfigs/macosx-universal/nightly
copy to browser/config/mozconfigs/macosx-lion-universal/nightly
--- a/browser/config/mozconfigs/macosx-universal/nightly
+++ b/browser/config/mozconfigs/macosx-lion-universal/nightly
@@ -10,14 +10,15 @@ ac_add_options --disable-install-strip
 
 # Nightlies only since this has a cost in performance
 ac_add_options --enable-js-diagnostics
 
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
 export MOZ_TELEMETRY_REPORTING=1
-mk_add_options MOZ_MAKE_FLAGS="-j4"
+mk_add_options MOZ_MAKE_FLAGS="-j12"
 
 ac_add_options --with-macbundlename-prefix=Firefox
 
 # Treat warnings as errors in directories with FAIL_ON_WARNINGS.
 ac_add_options --enable-warnings-as-errors
+ac_add_options --with-ccache
copy from browser/config/mozconfigs/macosx-universal/release
copy to browser/config/mozconfigs/macosx-lion-universal/release
--- a/browser/config/mozconfigs/macosx-universal/release
+++ b/browser/config/mozconfigs/macosx-lion-universal/release
@@ -12,8 +12,9 @@ export MOZILLA_OFFICIAL=1
 
 export MOZ_TELEMETRY_REPORTING=1
 
 # Treat warnings as errors in directories with FAIL_ON_WARNINGS.
 ac_add_options --enable-warnings-as-errors
 
 # Enable parallel compiling
 mk_add_options MOZ_MAKE_FLAGS="-j4"
+ac_add_options --with-ccache
copy from browser/config/mozconfigs/macosx-universal/shark
copy to browser/config/mozconfigs/macosx-lion-universal/shark
--- a/browser/config/mozconfigs/macosx-universal/shark
+++ b/browser/config/mozconfigs/macosx-lion-universal/shark
@@ -7,19 +7,20 @@ ac_add_options --enable-application=brow
 
 ac_add_options --disable-tests
 ac_add_options --disable-install-strip
 
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
 # Enable parallel compiling
-mk_add_options MOZ_MAKE_FLAGS="-j4"
+mk_add_options MOZ_MAKE_FLAGS="-j12"
 
 # shark specific options
 ac_add_options --enable-shark
 ac_add_options --enable-dtrace
 
 # Need this to prevent name conflicts with the normal nightly build packages
 export MOZ_PKG_SPECIAL="shark"
 
 # Treat warnings as errors in directories with FAIL_ON_WARNINGS.
 ac_add_options --enable-warnings-as-errors
+ac_add_options --with-ccache
copy from browser/config/mozconfigs/macosx32/debug
copy to browser/config/mozconfigs/macosx32-lion/debug
--- a/browser/config/mozconfigs/macosx32/debug
+++ b/browser/config/mozconfigs/macosx32-lion/debug
@@ -1,11 +1,12 @@
 . $topsrcdir/build/macosx/mozconfig.leopard
 ac_add_options --enable-debug
 ac_add_options --enable-trace-malloc
 
 # Enable parallel compiling
-mk_add_options MOZ_MAKE_FLAGS="-j4"
+mk_add_options MOZ_MAKE_FLAGS="-j12"
 
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
 ac_add_options --with-macbundlename-prefix=Firefox
+ac_add_options --with-ccache
copy from browser/config/mozconfigs/macosx64/debug
copy to browser/config/mozconfigs/macosx64-lion/debug
--- a/browser/config/mozconfigs/macosx64/debug
+++ b/browser/config/mozconfigs/macosx64-lion/debug
@@ -1,16 +1,17 @@
 . $topsrcdir/build/macosx/common
 
 ac_add_options --enable-debug
 ac_add_options --enable-trace-malloc
 ac_add_options --enable-accessibility
 
 # Enable parallel compiling
-mk_add_options MOZ_MAKE_FLAGS="-j4"
+mk_add_options MOZ_MAKE_FLAGS="-j12"
 
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
 ac_add_options --with-macbundlename-prefix=Firefox
 
 # Treat warnings as errors in directories with FAIL_ON_WARNINGS.
 ac_add_options --enable-warnings-as-errors
+ac_add_options --with-ccache
copy from browser/config/mozconfigs/macosx64/l10n-mozconfig
copy to browser/config/mozconfigs/macosx64-lion/l10n-mozconfig
--- a/browser/config/mozconfigs/macosx64/l10n-mozconfig
+++ b/browser/config/mozconfigs/macosx64-lion/l10n-mozconfig
@@ -1,4 +1,5 @@
 ac_add_options --with-l10n-base=../../l10n-central
 ac_add_options --enable-official-branding
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 ac_add_options --enable-update-packaging
+ac_add_options --with-ccache
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -145,19 +145,16 @@
 @BINPATH@/components/dom.xpt
 @BINPATH@/components/dom_base.xpt
 #ifdef MOZ_B2G_RIL
 @BINPATH@/components/dom_telephony.xpt
 @BINPATH@/components/dom_wifi.xpt
 @BINPATH@/components/dom_system_b2g.xpt
 #endif
 @BINPATH@/components/dom_battery.xpt
-#ifdef MOZ_B2G_BT
-@BINPATH@/components/dom_bluetooth.xpt
-#endif
 @BINPATH@/components/dom_canvas.xpt
 @BINPATH@/components/dom_core.xpt
 @BINPATH@/components/dom_css.xpt
 @BINPATH@/components/dom_events.xpt
 @BINPATH@/components/dom_geolocation.xpt
 @BINPATH@/components/dom_network.xpt
 @BINPATH@/components/dom_notification.xpt
 @BINPATH@/components/dom_html.xpt
--- a/build/Makefile.in
+++ b/build/Makefile.in
@@ -79,17 +79,17 @@ endif
 APP_BUILDID := $(shell cat $(DEPTH)/config/buildid)
 APP_INI_DEPS += $(DEPTH)/config/buildid
 
 DEFINES += -DGRE_MILESTONE=$(GRE_MILESTONE) -DAPP_BUILDID=$(APP_BUILDID)
 
 DEFINES += -DMOZ_APP_VERSION="$(MOZ_APP_VERSION)"
 APP_INI_DEPS += $(DEPTH)/config/autoconf.mk
 
-MOZ_SOURCE_STAMP ?= $(firstword $(shell hg -R $(topsrcdir)/$(MOZ_BUILD_APP)/.. parent --template="{node|short}\n" 2>/dev/null))
+MOZ_SOURCE_STAMP := $(firstword $(shell cd $(topsrcdir)/$(MOZ_BUILD_APP)/.. && hg parent --template="{node|short}\n" 2>/dev/null))
 ifdef MOZ_SOURCE_STAMP
 DEFINES += -DMOZ_SOURCE_STAMP="$(MOZ_SOURCE_STAMP)"
 endif
 
 _dollar=$$
 SOURCE_REPO := $(shell cd $(topsrcdir)/$(MOZ_BUILD_APP)/.. && hg showconfig paths.default 2>/dev/null | head -n1 | sed -e "s/^ssh:/http:/" -e "s/\/$(_dollar)//" )
 ifdef SOURCE_REPO
 DEFINES += -DMOZ_SOURCE_REPO="$(SOURCE_REPO)"
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -288,17 +288,16 @@ MOZ_ENABLE_GNOME_COMPONENT = @MOZ_ENABLE
 MOZ_ENABLE_GIO = @MOZ_ENABLE_GIO@
 MOZ_GIO_CFLAGS = @MOZ_GIO_CFLAGS@
 MOZ_GIO_LIBS = @MOZ_GIO_LIBS@
 
 MOZ_NATIVE_NSPR = @MOZ_NATIVE_NSPR@
 MOZ_NATIVE_NSS = @MOZ_NATIVE_NSS@
 
 MOZ_B2G_RIL = @MOZ_B2G_RIL@
-MOZ_B2G_BT = @MOZ_B2G_BT@
 
 BUILD_CTYPES = @BUILD_CTYPES@
 
 COMPILE_ENVIRONMENT = @COMPILE_ENVIRONMENT@
 CROSS_COMPILE   = @CROSS_COMPILE@
 
 WCHAR_CFLAGS	= @WCHAR_CFLAGS@
 
--- a/config/optimizejars.py
+++ b/config/optimizejars.py
@@ -30,17 +30,17 @@
 # use your version of this file under the terms of the MPL, indicate your
 # decision by deleting the provisions above and replace them with the notice
 # and other provisions required by the GPL or the LGPL. If you do not delete
 # the provisions above, a recipient may use your version of this file under
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
-import sys, os, subprocess, struct
+import sys, os, subprocess, struct, re
 
 local_file_header = [
     ("signature", "uint32"),
     ("min_version", "uint16"),
     ("general_flag", "uint16"),
     ("compression", "uint16"),
     ("lastmod_time", "uint16"),
     ("lastmod_date", "uint16"),
@@ -324,35 +324,37 @@ def optimizejar(jar, outjar, inlog = Non
                               reordered_count, len(central_directory), outjar)
     outfd.close()
     return outlog
         
 if len(sys.argv) != 5:
     print "Usage: --optimize|--deoptimize %s JAR_LOG_DIR IN_JAR_DIR OUT_JAR_DIR" % sys.argv[0]
     exit(1)
 
+jar_regex = re.compile("\\.jar?$")
+
 def optimize(JAR_LOG_DIR, IN_JAR_DIR, OUT_JAR_DIR):
     ls = os.listdir(IN_JAR_DIR)
     for jarfile in ls:
-        if not jarfile.endswith(".jar"):
+        if not re.search(jar_regex, jarfile):
             continue
         injarfile = os.path.join(IN_JAR_DIR, jarfile)
         outjarfile = os.path.join(OUT_JAR_DIR, jarfile) 
         logfile = os.path.join(JAR_LOG_DIR, jarfile + ".log")
         if not os.path.isfile(logfile):
             logfile = None
         optimizejar(injarfile, outjarfile, logfile)
 
 def deoptimize(JAR_LOG_DIR, IN_JAR_DIR, OUT_JAR_DIR):
     if not os.path.exists(JAR_LOG_DIR):
         os.makedirs(JAR_LOG_DIR)
 
     ls = os.listdir(IN_JAR_DIR)
     for jarfile in ls:
-        if not jarfile.endswith(".jar"):
+        if not re.search(jar_regex, jarfile):
             continue
         injarfile = os.path.join(IN_JAR_DIR, jarfile)
         outjarfile = os.path.join(OUT_JAR_DIR, jarfile) 
         logfile = os.path.join(JAR_LOG_DIR, jarfile + ".log")
         log = optimizejar(injarfile, outjarfile, None)
         open(logfile, "wb").write("\n".join(log))
 
 def main():        
--- a/configure.in
+++ b/configure.in
@@ -4974,17 +4974,16 @@ cairo-gonk)
     AC_DEFINE(MOZ_TOUCH)
     MOZ_WIDGET_TOOLKIT=gonk
     TK_CFLAGS='$(MOZ_CAIRO_CFLAGS)'
     TK_LIBS='$(MOZ_CAIRO_LIBS)'
     MOZ_WEBGL=1
     MOZ_PDF_PRINTING=1
     MOZ_B2G_RIL=1
     MOZ_TOUCH=1
-    MOZ_B2G_BT=1
     ;;
 
 esac
 
 AC_SUBST(MOZ_OLD_LINKER)
 AC_SUBST(MOZ_PDF_PRINTING)
 if test "$MOZ_PDF_PRINTING"; then
    PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
@@ -7659,28 +7658,16 @@ MOZ_ARG_ENABLE_BOOL(b2g-ril,
     MOZ_B2G_RIL=1,
     MOZ_B2G_RIL= )
 if test -n "$MOZ_B2G_RIL"; then
    AC_DEFINE(MOZ_B2G_RIL)
 fi
 AC_SUBST(MOZ_B2G_RIL)
 
 dnl ========================================================
-dnl = Enable Bluetooth Interface for B2G (Gonk usually)
-dnl ========================================================
-MOZ_ARG_ENABLE_BOOL(b2g-bt,
-[  --enable-b2g-bt      Set compile flags necessary for compiling Bluetooth API for B2G ],
-    MOZ_B2G_BT=1,
-    MOZ_B2G_BT= )
-if test -n "$MOZ_B2G_BT"; then
-   AC_DEFINE(MOZ_B2G_BT)
-fi
-AC_SUBST(MOZ_B2G_BT)
-
-dnl ========================================================
 dnl = Support for demangling undefined symbols
 dnl ========================================================
 if test -z "$SKIP_LIBRARY_CHECKS"; then
     AC_LANG_SAVE
     AC_LANG_CPLUSPLUS
     AC_CHECK_FUNCS(__cxa_demangle, HAVE_DEMANGLE=1, HAVE_DEMANGLE=)
     AC_LANG_RESTORE
 fi
--- a/dom/Makefile.in
+++ b/dom/Makefile.in
@@ -92,19 +92,14 @@ DIRS += \
 
 ifdef MOZ_B2G_RIL
 DIRS += \
   telephony \
   wifi \
   $(NULL)
 endif
 
-ifdef MOZ_B2G_BT
-DIRS += \
-  bluetooth \
-  $(NULL)
-endif
 TEST_DIRS += tests
 ifneq (,$(filter gtk2 cocoa windows android qt os2,$(MOZ_WIDGET_TOOLKIT)))
 TEST_DIRS += plugins/test
 endif
 
 include $(topsrcdir)/config/rules.mk
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -75,20 +75,16 @@
 #include "mozilla/Hal.h"
 #include "nsIWebNavigation.h"
 #include "mozilla/ClearOnShutdown.h"
 #include "Connection.h"
 
 #ifdef MOZ_B2G_RIL
 #include "TelephonyFactory.h"
 #endif
-#ifdef MOZ_B2G_BT
-#include "nsIDOMBluetoothAdapter.h"
-#include "BluetoothAdapter.h"
-#endif
 
 // This should not be in the namespace.
 DOMCI_DATA(Navigator, mozilla::dom::Navigator)
 
 namespace mozilla {
 namespace dom {
 
 static const char sJSStackContractID[] = "@mozilla.org/js/xpc/ContextStack;1";
@@ -132,19 +128,16 @@ NS_INTERFACE_MAP_BEGIN(Navigator)
   NS_INTERFACE_MAP_ENTRY(nsIDOMNavigatorGeolocation)
   NS_INTERFACE_MAP_ENTRY(nsIDOMMozNavigatorBattery)
   NS_INTERFACE_MAP_ENTRY(nsIDOMNavigatorDesktopNotification)
   NS_INTERFACE_MAP_ENTRY(nsIDOMMozNavigatorSms)
 #ifdef MOZ_B2G_RIL
   NS_INTERFACE_MAP_ENTRY(nsIDOMNavigatorTelephony)
 #endif
   NS_INTERFACE_MAP_ENTRY(nsIDOMMozNavigatorNetwork)
-#ifdef MOZ_B2G_BT
-  NS_INTERFACE_MAP_ENTRY(nsIDOMNavigatorBluetooth)
-#endif
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(Navigator)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_ADDREF(Navigator)
 NS_IMPL_RELEASE(Navigator)
 
 void
 Navigator::Invalidate()
@@ -184,22 +177,16 @@ Navigator::Invalidate()
     mTelephony = nsnull;
   }
 #endif
 
   if (mConnection) {
     mConnection->Shutdown();
     mConnection = nsnull;
   }
-
-#ifdef MOZ_B2G_BT
-  if (mBluetooth) {
-    mBluetooth = nsnull;
-  }
-#endif
 }
 
 nsPIDOMWindow *
 Navigator::GetWindow()
 {
   nsCOMPtr<nsPIDOMWindow> win(do_QueryReferent(mWindow));
 
   return win;
@@ -1120,40 +1107,16 @@ Navigator::GetMozConnection(nsIDOMMozCon
     mConnection = new network::Connection();
     mConnection->Init(window, scx);
   }
 
   NS_ADDREF(*aConnection = mConnection);
   return NS_OK;
 }
 
-#ifdef MOZ_B2G_BT
-//*****************************************************************************
-//    nsNavigator::nsIDOMNavigatorBluetooth
-//*****************************************************************************
-
-NS_IMETHODIMP
-Navigator::GetMozBluetooth(nsIDOMBluetoothAdapter** aBluetooth)
-{
-  nsCOMPtr<nsIDOMBluetoothAdapter> bluetooth = mBluetooth;
-
-  if (!bluetooth) {
-    nsCOMPtr<nsPIDOMWindow> window = do_QueryReferent(mWindow);
-    NS_ENSURE_TRUE(window, NS_ERROR_FAILURE);
-
-    mBluetooth = new bluetooth::BluetoothAdapter();
-
-    bluetooth = mBluetooth;
-  }
-
-  bluetooth.forget(aBluetooth);
-  return NS_OK;
-}
-#endif //MOZ_B2G_BT
-
 PRInt64
 Navigator::SizeOf() const
 {
   PRInt64 size = sizeof(*this);
 
   // TODO: add SizeOf() to nsMimeTypeArray, bug 674113.
   size += mMimeTypes ? sizeof(*mMimeTypes.get()) : 0;
   // TODO: add SizeOf() to nsPluginArray, bug 674114.
--- a/dom/base/Navigator.h
+++ b/dom/base/Navigator.h
@@ -60,21 +60,16 @@ class nsDesktopNotificationCenter;
 class nsPIDOMWindow;
 class nsIDOMMozConnection;
 
 #ifdef MOZ_B2G_RIL
 #include "nsIDOMNavigatorTelephony.h"
 class nsIDOMTelephony;
 #endif
 
-#ifdef MOZ_B2G_BT
-#include "nsIDOMNavigatorBluetooth.h"
-#endif
-
-class nsIDOMAdapter;
 //*****************************************************************************
 // Navigator: Script "navigator" object
 //*****************************************************************************
 
 namespace mozilla {
 namespace dom {
 
 namespace battery {
@@ -98,19 +93,16 @@ class Navigator : public nsIDOMNavigator
                 , public nsIDOMNavigatorGeolocation
                 , public nsIDOMNavigatorDesktopNotification
                 , public nsIDOMMozNavigatorBattery
                 , public nsIDOMMozNavigatorSms
 #ifdef MOZ_B2G_RIL
                 , public nsIDOMNavigatorTelephony
 #endif
                 , public nsIDOMMozNavigatorNetwork
-#ifdef MOZ_B2G_BT
-                , public nsIDOMNavigatorBluetooth
-#endif
 {
 public:
   Navigator(nsPIDOMWindow *aInnerWindow);
   virtual ~Navigator();
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSIDOMNAVIGATOR
   NS_DECL_NSIDOMCLIENTINFORMATION
@@ -118,20 +110,16 @@ public:
   NS_DECL_NSIDOMNAVIGATORDESKTOPNOTIFICATION
   NS_DECL_NSIDOMMOZNAVIGATORBATTERY
   NS_DECL_NSIDOMMOZNAVIGATORSMS
 #ifdef MOZ_B2G_RIL
   NS_DECL_NSIDOMNAVIGATORTELEPHONY
 #endif
   NS_DECL_NSIDOMMOZNAVIGATORNETWORK
 
-#ifdef MOZ_B2G_BT
-  NS_DECL_NSIDOMNAVIGATORBLUETOOTH
-#endif
-
   static void Init();
 
   void Invalidate();
   nsPIDOMWindow *GetWindow();
 
   void RefreshMIMEArray();
 
   static bool HasDesktopNotificationSupport();
@@ -153,19 +141,16 @@ private:
   nsRefPtr<nsDesktopNotificationCenter> mNotification;
   nsRefPtr<battery::BatteryManager> mBatteryManager;
   nsRefPtr<power::PowerManager> mPowerManager;
   nsRefPtr<sms::SmsManager> mSmsManager;
 #ifdef MOZ_B2G_RIL
   nsCOMPtr<nsIDOMTelephony> mTelephony;
 #endif
   nsRefPtr<network::Connection> mConnection;
-#ifdef MOZ_B2G_BT
-  nsCOMPtr<nsIDOMBluetoothAdapter> mBluetooth;
-#endif
   nsWeakPtr mWindow;
 };
 
 } // namespace dom
 } // namespace mozilla
 
 nsresult NS_GetNavigatorUserAgent(nsAString& aUserAgent);
 nsresult NS_GetNavigatorPlatform(nsAString& aPlatform);
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -527,20 +527,16 @@ using mozilla::dom::indexedDB::IDBWrappe
 #include "mozilla/dom/network/Utils.h"
 
 #ifdef MOZ_B2G_RIL
 #include "Telephony.h"
 #include "TelephonyCall.h"
 #include "CallEvent.h"
 #endif
 
-#ifdef MOZ_B2G_BT
-#include "BluetoothAdapter.h"
-#endif
-
 #include "DOMError.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 static NS_DEFINE_CID(kDOMSOF_CID, NS_DOM_SCRIPT_OBJECT_FACTORY_CID);
 
 static const char kDOMStringBundleURL[] =
@@ -1626,21 +1622,16 @@ static nsDOMClassInfoData sClassInfoData
   NS_DEFINE_CLASSINFO_DATA(Telephony, nsEventTargetSH,
                            EVENTTARGET_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(TelephonyCall, nsEventTargetSH,
                            EVENTTARGET_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(CallEvent, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
 #endif
 
-#ifdef MOZ_B2G_BT
-  NS_DEFINE_CLASSINFO_DATA(BluetoothAdapter, nsDOMGenericSH,
-                           DOM_DEFAULT_SCRIPTABLE_FLAGS)
-#endif
-
   NS_DEFINE_CLASSINFO_DATA(DOMError, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
 };
 
 // Objects that should be constructable through |new Name();|
 struct nsContractIDMapData
 {
   PRInt32 mDOMClassInfoID;
@@ -2427,19 +2418,16 @@ nsDOMClassInfo::Init()
     DOM_CLASSINFO_MAP_CONDITIONAL_ENTRY(nsIDOMMozNavigatorBattery,
                                         battery::BatteryManager::HasSupport())
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozNavigatorSms)
 #ifdef MOZ_B2G_RIL
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMNavigatorTelephony)
 #endif
     DOM_CLASSINFO_MAP_CONDITIONAL_ENTRY(nsIDOMMozNavigatorNetwork,
                                         network::IsAPIEnabled())
-#ifdef MOZ_B2G_BT
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMNavigatorBluetooth)
-#endif
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN(Plugin, nsIDOMPlugin)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMPlugin)
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN(PluginArray, nsIDOMPluginArray)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMPluginArray)
@@ -4372,22 +4360,16 @@ nsDOMClassInfo::Init()
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN(CallEvent, nsIDOMCallEvent)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMCallEvent)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMEvent)
   DOM_CLASSINFO_MAP_END
 #endif
 
-#ifdef MOZ_B2G_BT
-  DOM_CLASSINFO_MAP_BEGIN(BluetoothAdapter, nsIDOMBluetoothAdapter)
-    DOM_CLASSINFO_MAP_ENTRY(nsIDOMBluetoothAdapter)
-  DOM_CLASSINFO_MAP_END
-#endif
-
   DOM_CLASSINFO_MAP_BEGIN(DOMError, nsIDOMDOMError)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMDOMError)
   DOM_CLASSINFO_MAP_END
 
 #ifdef NS_DEBUG
   {
     PRUint32 i = ArrayLength(sClassInfoData);
 
--- a/dom/base/nsDOMClassInfoClasses.h
+++ b/dom/base/nsDOMClassInfoClasses.h
@@ -535,13 +535,9 @@ DOMCI_CLASS(MediaQueryList)
 DOMCI_CLASS(CustomEvent)
 
 #ifdef MOZ_B2G_RIL
 DOMCI_CLASS(Telephony)
 DOMCI_CLASS(TelephonyCall)
 DOMCI_CLASS(CallEvent)
 #endif
 
-#ifdef MOZ_B2G_BT
-DOMCI_CLASS(BluetoothAdapter)
-#endif
-
 DOMCI_CLASS(DOMError)
deleted file mode 100644
--- a/dom/bluetooth/BluetoothAdapter.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
-/* vim: set ts=2 et sw=2 tw=40: */
-/* 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/. */
-
-#include "BluetoothAdapter.h"
-#include "nsDOMClassInfo.h"
-
-USING_BLUETOOTH_NAMESPACE
-
-BluetoothAdapter::BluetoothAdapter() : mPower(false)
-{
-}
-
-NS_INTERFACE_MAP_BEGIN(BluetoothAdapter)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMBluetoothAdapter)
-  NS_INTERFACE_MAP_ENTRY(nsISupports)
-  NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(BluetoothAdapter)
-NS_INTERFACE_MAP_END
-  
-NS_IMPL_ADDREF(BluetoothAdapter)
-NS_IMPL_RELEASE(BluetoothAdapter)
-
-DOMCI_DATA(BluetoothAdapter, BluetoothAdapter)
-  
-NS_IMETHODIMP
-BluetoothAdapter::GetPower(bool* aPower)
-{
-  *aPower = mPower;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-BluetoothAdapter::SetPower(bool aPower)
-{
-  mPower = aPower;
-  return NS_OK;
-}
deleted file mode 100644
--- a/dom/bluetooth/BluetoothAdapter.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
-/* vim: set ts=2 et sw=2 tw=40: */
-/* 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/. */
-
-#ifndef mozilla_dom_bluetooth_bluetoothadapter_h__
-#define mozilla_dom_bluetooth_bluetoothadapter_h__
-
-#include "BluetoothCommon.h"
-#include "nsIDOMBluetoothAdapter.h"
-
-BEGIN_BLUETOOTH_NAMESPACE
-
-class BluetoothAdapter : public nsIDOMBluetoothAdapter
-{
-public:
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIDOMBLUETOOTHADAPTER
-
-  BluetoothAdapter();
-
-protected:
-  bool mPower;
-};
-
-END_BLUETOOTH_NAMESPACE
-#endif
deleted file mode 100644
--- a/dom/bluetooth/BluetoothCommon.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
-/* vim: set ts=2 et sw=2 tw=40: */
-/* 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/. */
-
-#ifndef mozilla_dom_bluetooth_bluetoothcommon_h__
-#define mozilla_dom_bluetooth_bluetoothcommon_h__
-
-#define BEGIN_BLUETOOTH_NAMESPACE \
-  namespace mozilla { namespace dom { namespace bluetooth {
-#define END_BLUETOOTH_NAMESPACE \
-  } /* namespace bluetooth */ } /* namespace dom */ } /* namespace mozilla */
-#define USING_BLUETOOTH_NAMESPACE \
-  using namespace mozilla::dom::bluetooth;
-
-class nsIDOMBluetooth;
-
-#endif // mozilla_dom_bluetooth_bluetoothcommon_h__
deleted file mode 100644
--- a/dom/bluetooth/Makefile.in
+++ /dev/null
@@ -1,30 +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/.
-
-DEPTH            = ../..
-topsrcdir        = @top_srcdir@
-srcdir           = @srcdir@
-VPATH            = @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-MODULE           = dom
-LIBRARY_NAME     = dombluetooth_s
-XPIDL_MODULE     = dom_bluetooth
-LIBXUL_LIBRARY   = 1
-FORCE_STATIC_LIB = 1
-
-include $(topsrcdir)/dom/dom-config.mk
-
-CPPSRCS = \
-  BluetoothAdapter.cpp \
-  $(NULL)
-
-XPIDLSRCS = \
-  nsIDOMNavigatorBluetooth.idl \
-  nsIDOMBluetoothAdapter.idl \
-  $(NULL)
-
-include $(topsrcdir)/config/rules.mk
-
deleted file mode 100644
--- a/dom/bluetooth/nsIDOMBluetoothAdapter.idl
+++ /dev/null
@@ -1,13 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
-/* vim: set ts=2 et sw=2 tw=40: */
-/* 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/. */
-
-#include "nsISupports.idl"
-
-[scriptable, builtinclass, uuid(29689a22-45ff-4ccf-b552-5364ce3a3642)]
-interface nsIDOMBluetoothAdapter : nsISupports
-{
-  attribute boolean power;
-};
deleted file mode 100644
--- a/dom/bluetooth/nsIDOMNavigatorBluetooth.idl
+++ /dev/null
@@ -1,15 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
-/* vim: set ts=2 et sw=2 tw=40: */
-/* 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/. */
-
-#include "nsISupports.idl"
-
-interface nsIDOMBluetoothAdapter;
-
-[scriptable, uuid(677f2c2d-c4d1-41ea-addc-21d30d0d3858)]
-interface nsIDOMNavigatorBluetooth : nsISupports
-{
-  readonly attribute nsIDOMBluetoothAdapter mozBluetooth;
-};
--- a/dom/dom-config.mk
+++ b/dom/dom-config.mk
@@ -26,14 +26,10 @@ DOM_SRCDIRS = \
 ifdef MOZ_B2G_RIL
 DOM_SRCDIRS += \
   dom/system/b2g \
   dom/telephony \
   dom/wifi \
   $(NULL)
 endif
 
-ifdef MOZ_B2G_BT
-DOM_SRCDIRS += dom/bluetooth
-endif
-
 LOCAL_INCLUDES += $(DOM_SRCDIRS:%=-I$(topsrcdir)/%)
 DEFINES += -D_IMPL_NS_LAYOUT
--- a/layout/build/Makefile.in
+++ b/layout/build/Makefile.in
@@ -143,20 +143,16 @@ SHARED_LIBRARY_LIBS += \
 	$(DEPTH)/dom/plugins/base/android/$(LIB_PREFIX)gkpluginandroid_s.$(LIB_SUFFIX) \
 	$(NULL)
 LOCAL_INCLUDES	+= \
 	-I$(topsrcdir)/dom/system/android \
 	-I$(topsrcdir)/dom/system \
 	$(NULL)
 endif
 
-ifdef MOZ_B2G_BT #{
-SHARED_LIBRARY_LIBS	+= $(DEPTH)/dom/bluetooth/$(LIB_PREFIX)dombluetooth_s.$(LIB_SUFFIX)
-endif #}
-
 ifdef MOZ_B2G_RIL #{
 SHARED_LIBRARY_LIBS	+= $(DEPTH)/dom/system/b2g/$(LIB_PREFIX)domsystemb2g_s.$(LIB_SUFFIX)
 endif #}
 
 ifdef MOZ_MEDIA
 SHARED_LIBRARY_LIBS 	+= \
 	$(DEPTH)/content/media/$(LIB_PREFIX)gkconmedia_s.$(LIB_SUFFIX) \
 	$(NULL)
@@ -271,13 +267,10 @@ LOCAL_INCLUDES	+= -I$(srcdir)/../base \
 		   -I$(topsrcdir)/netwerk/base/src \
 		   -I$(topsrcdir)/content/svg/content/src \
 		   $(NULL)
 
 ifdef MOZ_B2G_RIL #{
 LOCAL_INCLUDES	+= -I$(topsrcdir)/dom/system/b2g
 endif #}
 
-ifdef MOZ_B2G_BT #{
-LOCAL_INCLUDES	+= -I$(topsrcdir)/dom/bluetooth
-endif #}
 
 DEFINES += -D_IMPL_NS_LAYOUT
--- a/mobile/xul/installer/package-manifest.in
+++ b/mobile/xul/installer/package-manifest.in
@@ -152,19 +152,16 @@
 @BINPATH@/components/dom.xpt
 @BINPATH@/components/dom_base.xpt
 #ifdef MOZ_B2G_RIL
 @BINPATH@/components/dom_telephony.xpt
 @BINPATH@/components/dom_wifi.xpt
 @BINPATH@/components/dom_system_b2g.xpt
 #endif
 @BINPATH@/components/dom_battery.xpt
-#ifdef MOZ_B2G_BT
-@BINPATH@/components/dom_bluetooth.xpt
-#endif
 @BINPATH@/components/dom_canvas.xpt
 @BINPATH@/components/dom_core.xpt
 @BINPATH@/components/dom_css.xpt
 @BINPATH@/components/dom_events.xpt
 @BINPATH@/components/dom_geolocation.xpt
 @BINPATH@/components/dom_network.xpt
 @BINPATH@/components/dom_notification.xpt
 @BINPATH@/components/dom_html.xpt
--- a/nsprpub/TAG-INFO
+++ b/nsprpub/TAG-INFO
@@ -1,1 +1,1 @@
-NSPR_4_9_BETA7
+NSPR_4_9_RTM
--- a/nsprpub/config/prdepend.h
+++ b/nsprpub/config/prdepend.h
@@ -38,9 +38,8 @@
 /*
  * A dummy header file that is a dependency for all the object files.
  * Used to force a full recompilation of NSPR in Mozilla's Tinderbox
  * depend builds.  See comments in rules.mk.
  */
 
 #error "Do not include this header file."
 
-
--- a/nsprpub/pr/include/prinit.h
+++ b/nsprpub/pr/include/prinit.h
@@ -58,21 +58,21 @@ PR_BEGIN_EXTERN_C
 /*
 ** NSPR's version is used to determine the likelihood that the version you
 ** used to build your component is anywhere close to being compatible with
 ** what is in the underlying library.
 **
 ** The format of the version string is
 **     "<major version>.<minor version>[.<patch level>] [<Beta>]"
 */
-#define PR_VERSION  "4.9 Beta"
+#define PR_VERSION  "4.9"
 #define PR_VMAJOR   4
 #define PR_VMINOR   9
 #define PR_VPATCH   0
-#define PR_BETA     PR_TRUE
+#define PR_BETA     PR_FALSE
 
 /*
 ** PRVersionCheck
 **
 ** The basic signature of the function that is called to provide version
 ** checking. The result will be a boolean that indicates the likelihood
 ** that the underling library will perform as the caller expects.
 **
deleted file mode 100644
--- a/security/patches/bug-717906-lowhash
+++ /dev/null
@@ -1,115 +0,0 @@
-diff --git a/security/coreconf/Linux.mk b/security/coreconf/Linux.mk
---- a/security/coreconf/Linux.mk
-+++ b/security/coreconf/Linux.mk
-@@ -171,16 +171,17 @@ CPU_TAG = _$(CPU_ARCH)
- #
- # On Linux 2.6 or later, build libfreebl3.so with no NSPR and libnssutil3.so
- # dependencies by default.  Set FREEBL_NO_DEPEND to 0 in the environment to
- # override this.
- #
- ifeq (2.6,$(firstword $(sort 2.6 $(OS_RELEASE))))
- ifndef FREEBL_NO_DEPEND
- FREEBL_NO_DEPEND = 1
-+FREEBL_LOWHASH = 1
- endif
- endif
- 
- USE_SYSTEM_ZLIB = 1
- ZLIB_LIBS = -lz
- 
- # The -rpath '$$ORIGIN' linker option instructs this library to search for its
- # dependencies in the same directory where it resides.
-diff --git a/security/nss/lib/freebl/Makefile b/security/nss/lib/freebl/Makefile
---- a/security/nss/lib/freebl/Makefile
-+++ b/security/nss/lib/freebl/Makefile
-@@ -71,17 +71,21 @@ ifdef USE_64
- endif
- 
- ifdef USE_ABI32_FPU
- 	DEFINES += -DNSS_USE_ABI32_FPU
- endif
- 
- ifeq ($(FREEBL_NO_DEPEND),1)
- 	DEFINES += -DFREEBL_NO_DEPEND
--	LOWHASH_SRCS = stubs.c nsslowhash.c
-+	STUBS_SRCS = stubs.c
-+endif
-+
-+ifeq ($(FREEBL_LOWHASH),1)
-+	LOWHASH_SRCS = nsslowhash.c
- 	LOWHASH_EXPORTS = nsslowhash.h
- 	MAPFILE_SOURCE = freebl_hash.def
- else
- 	MAPFILE_SOURCE = freebl.def
- endif
- 
- # FREEBL_USE_PRELINK
- #
-diff --git a/security/nss/lib/freebl/manifest.mn b/security/nss/lib/freebl/manifest.mn
---- a/security/nss/lib/freebl/manifest.mn
-+++ b/security/nss/lib/freebl/manifest.mn
-@@ -145,16 +145,17 @@ CSRCS = \
- 	rsa.c \
- 	shvfy.c \
- 	tlsprfalg.c \
- 	seed.c \
- 	jpake.c \
- 	$(MPI_SRCS) \
- 	$(MPCPU_SRCS) \
- 	$(ECL_SRCS) \
-+	$(STUBS_SRCS) \
- 	$(LOWHASH_SRCS) \
- 	$(NULL)
- 
- ALL_CSRCS := $(CSRCS)
- 
- ALL_HDRS =  \
- 	alghmac.h \
- 	blapi.h \
-diff --git a/security/nss/lib/freebl/nsslowhash.c b/security/nss/lib/freebl/nsslowhash.c
---- a/security/nss/lib/freebl/nsslowhash.c
-+++ b/security/nss/lib/freebl/nsslowhash.c
-@@ -30,17 +30,19 @@
-  * decision by deleting the provisions above and replace them with the notice
-  * and other provisions required by the GPL or the LGPL. If you do not delete
-  * the provisions above, a recipient may use your version of this file under
-  * the terms of any one of the MPL, the GPL or the LGPL.
-  *
-  * ***** END LICENSE BLOCK ***** */
- /* $Id: nsslowhash.c,v 1.6 2010/09/10 00:42:36 emaldona%redhat.com Exp $ */
- 
-+#ifdef FREEBL_NO_DEPEND
- #include "stubs.h"
-+#endif
- #include "prtypes.h"
- #include "secerr.h"
- #include "pkcs11t.h"
- #include "blapi.h"
- #include "sechash.h"
- #include "nsslowhash.h"
- 
- /* FIPS preprocessor directives for message digests             */
-@@ -312,21 +314,23 @@ static int post_failed = 0;
- 
- static NSSLOWInitContext dummyContext = { 0 };
- 
- NSSLOWInitContext *
- NSSLOW_Init(void)
- {
-     SECStatus rv;
-     CK_RV crv;
-+#ifdef FREEBL_NO_DEPEND
-     PRBool nsprAvailable = PR_FALSE;
- 
- 
-     rv = FREEBL_InitStubs();
-     nsprAvailable = (rv ==  SECSuccess ) ? PR_TRUE : PR_FALSE;
-+#endif
- 
-     if (post_failed) {
- 	return NULL;
-     }
- 	
- 
-     if (!post && nsslow_GetFIPSEnabled()) {
- 	crv = freebl_fipsPowerUpSelfTest();
--- a/toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
+++ b/toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
@@ -104,17 +104,18 @@ NS_IMPL_RELEASE(nsTypeAheadFind)
 static NS_DEFINE_CID(kFrameTraversalCID, NS_FRAMETRAVERSAL_CID);
 
 #define NS_FIND_CONTRACTID "@mozilla.org/embedcomp/rangefind;1"
 
 nsTypeAheadFind::nsTypeAheadFind():
   mStartLinksOnlyPref(false),
   mCaretBrowsingOn(false),
   mLastFindLength(0),
-  mIsSoundInitialized(false)
+  mIsSoundInitialized(false),
+  mCaseSensitive(false)
 {
 }
 
 nsTypeAheadFind::~nsTypeAheadFind()
 {
   nsCOMPtr<nsIPrefBranch> prefInternal(do_GetService(NS_PREFSERVICE_CONTRACTID));
   if (prefInternal) {
     prefInternal->RemoveObserver("accessibility.typeaheadfind", this);
@@ -124,33 +125,28 @@ nsTypeAheadFind::~nsTypeAheadFind()
 
 nsresult
 nsTypeAheadFind::Init(nsIDocShell* aDocShell)
 {
   nsCOMPtr<nsIPrefBranch> prefInternal(do_GetService(NS_PREFSERVICE_CONTRACTID));
   mSearchRange = new nsRange();
   mStartPointRange = new nsRange();
   mEndPointRange = new nsRange();
-  mFind = do_CreateInstance(NS_FIND_CONTRACTID);
-  if (!prefInternal || !mFind)
+  if (!prefInternal || !EnsureFind())
     return NS_ERROR_FAILURE;
 
   SetDocShell(aDocShell);
 
   // ----------- Listen to prefs ------------------
   nsresult rv = prefInternal->AddObserver("accessibility.browsewithcaret", this, true);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // ----------- Get initial preferences ----------
   PrefsReset();
 
-  // ----------- Set search options ---------------
-  mFind->SetCaseSensitive(false);
-  mFind->SetWordBreaker(nsnull);
-
   return rv;
 }
 
 nsresult
 nsTypeAheadFind::PrefsReset()
 {
   nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID));
   NS_ENSURE_TRUE(prefBranch, NS_ERROR_FAILURE);
@@ -171,24 +167,30 @@ nsTypeAheadFind::PrefsReset()
                           &mCaretBrowsingOn);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsTypeAheadFind::SetCaseSensitive(bool isCaseSensitive)
 {
-  mFind->SetCaseSensitive(isCaseSensitive);
+  mCaseSensitive = isCaseSensitive;
+
+  if (mFind) {
+    mFind->SetCaseSensitive(mCaseSensitive);
+  }
+
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsTypeAheadFind::GetCaseSensitive(bool* isCaseSensitive)
 {
-  mFind->GetCaseSensitive(isCaseSensitive);
+  *isCaseSensitive = mCaseSensitive;
+
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsTypeAheadFind::SetDocShell(nsIDocShell* aDocShell)
 {
   mDocShell = do_GetWeakReference(aDocShell);
 
@@ -197,23 +199,26 @@ nsTypeAheadFind::SetDocShell(nsIDocShell
 
   nsCOMPtr<nsIPresShell> presShell;
   aDocShell->GetPresShell(getter_AddRefs(presShell));
   mPresShell = do_GetWeakReference(presShell);      
 
   mStartFindRange = nsnull;
   mStartPointRange = new nsRange();
   mSearchRange = new nsRange();
+  mEndPointRange = new nsRange();
 
   mFoundLink = nsnull;
   mFoundEditable = nsnull;
   mCurrentWindow = nsnull;
 
   mSelectionController = nsnull;
 
+  mFind = nsnull;
+
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsTypeAheadFind::SetSelectionModeAndRepaint(PRInt16 aToggle)
 {
   nsCOMPtr<nsISelectionController> selectionController = 
     do_QueryReferent(mSelectionController);
@@ -388,17 +393,17 @@ nsTypeAheadFind::FindItNow(nsIPresShell 
     return NS_ERROR_FAILURE;
   }
 
   PRInt16 rangeCompareResult = 0;
   mStartPointRange->CompareBoundaryPoints(nsIDOMRange::START_TO_START, mSearchRange, &rangeCompareResult);
   // No need to wrap find in doc if starting at beginning
   bool hasWrapped = (rangeCompareResult < 0);
 
-  if (mTypeAheadBuffer.IsEmpty())
+  if (mTypeAheadBuffer.IsEmpty() || !EnsureFind())
     return NS_ERROR_FAILURE;
 
   mFind->SetFindBackwards(aFindPrev);
 
   while (true) {    // ----- Outer while loop: go through all docs -----
     while (true) {  // === Inner while loop: go through a single doc ===
       mFind->Find(mTypeAheadBuffer.get(), mSearchRange, mStartPointRange,
                   mEndPointRange, getter_AddRefs(returnRange));
--- a/toolkit/components/typeaheadfind/nsTypeAheadFind.h
+++ b/toolkit/components/typeaheadfind/nsTypeAheadFind.h
@@ -123,16 +123,35 @@ protected:
   // where selection was when user started the find
   nsCOMPtr<nsIDOMRange> mStartFindRange;
   nsCOMPtr<nsIDOMRange> mSearchRange;
   nsCOMPtr<nsIDOMRange> mStartPointRange;
   nsCOMPtr<nsIDOMRange> mEndPointRange;
 
   // Cached useful interfaces
   nsCOMPtr<nsIFind> mFind;
+
+  bool mCaseSensitive;
+
+  bool EnsureFind() {
+    if (mFind) {
+      return true;
+    }
+
+    mFind = do_CreateInstance("@mozilla.org/embedcomp/rangefind;1");
+    if (!mFind) {
+      return false;
+    }
+
+    mFind->SetCaseSensitive(mCaseSensitive);
+    mFind->SetWordBreaker(nsnull);
+
+    return true;
+  }
+
   nsCOMPtr<nsIWebBrowserFind> mWebBrowserFind;
 
   // The focused content window that we're listening to and its cached objects
   nsWeakPtr mDocShell;
   nsWeakPtr mPresShell;
   nsWeakPtr mSelectionController;
                                           // Most recent match's controller
 };
--- a/toolkit/library/Makefile.in
+++ b/toolkit/library/Makefile.in
@@ -393,19 +393,16 @@ OS_LIBS += \
   -lhardware_legacy \
   -lhardware \
   -lutils \
   -lcutils \
   -lcamera_client \
   -lbinder \
   -lsensorservice \
   $(NULL)
-ifdef MOZ_B2G_BT
-OS_LIBS += -lbluedroid
-endif
 endif
 
 EXTRA_DEPS += \
   $(topsrcdir)/intl/unicharutil/util/objs.mk \
   $(topsrcdir)/rdf/util/src/objs.mk \
   $(NULL)
 
 CPPSRCS += \
--- a/widget/windows/GfxInfo.cpp
+++ b/widget/windows/GfxInfo.cpp
@@ -506,16 +506,20 @@ GfxInfo::Init()
                 result = RegQueryValueExW(key, L"DriverDate", NULL, NULL, (LPBYTE)value, &dwcbData);
                 if (result != ERROR_SUCCESS) {
                   RegCloseKey(key);
                   continue;
                 }
                 driverDate2 = value;
                 dwcbData = sizeof(value);
                 result = RegQueryValueExW(key, L"Device Description", NULL, NULL, (LPBYTE)value, &dwcbData);
+                if (result != ERROR_SUCCESS) {
+                  dwcbData = sizeof(value);
+                  result = RegQueryValueExW(key, L"DriverDesc", NULL, NULL, (LPBYTE)value, &dwcbData);
+                }
                 RegCloseKey(key);
                 if (result == ERROR_SUCCESS) {
                   mHasDualGPU = true;
                   mDeviceString2 = value;
                   mDeviceID2 = deviceID2;
                   mDeviceKey2 = driverKey2;
                   mDriverVersion2 = driverVersion2;
                   mDriverDate2 = driverDate2;
--- a/xpcom/base/nsCycleCollector.cpp
+++ b/xpcom/base/nsCycleCollector.cpp
@@ -1411,46 +1411,101 @@ GraphWalker<Visitor>::DoWalk(nsDeque &aQ
         }
     };
 
 #ifdef DEBUG_CC
     sCollector->mStats.mWalkedGraph++;
 #endif
 }
 
+struct CCGraphDescriber
+{
+  CCGraphDescriber()
+  : mAddress("0x"), mToAddress("0x"), mCnt(0), mType(eUnknown) {}
+
+  enum Type
+  {
+    eRefCountedObject,
+    eGCedObject,
+    eGCMarkedObject,
+    eEdge,
+    eRoot,
+    eGarbage,
+    eUnknown
+  };
+
+  nsCString mAddress;
+  nsCString mToAddress;
+  nsCString mName;
+  PRUint32 mCnt;
+  Type mType;
+};
 
 class nsCycleCollectorLogger : public nsICycleCollectorListener
 {
 public:
-    nsCycleCollectorLogger() : mStream(nsnull), mWantAllTraces(false)
+    nsCycleCollectorLogger() :
+      mStream(nsnull), mWantAllTraces(false),
+      mDisableLog(false), mWantAfterProcessing(false),
+      mNextIndex(0)
     {
     }
     ~nsCycleCollectorLogger()
     {
         if (mStream) {
             fclose(mStream);
         }
     }
     NS_DECL_ISUPPORTS
 
     NS_IMETHOD AllTraces(nsICycleCollectorListener** aListener)
     {
-      mWantAllTraces = true;
-      NS_ADDREF(*aListener = this);
-      return NS_OK;
+        mWantAllTraces = true;
+        NS_ADDREF(*aListener = this);
+        return NS_OK;
     }
 
     NS_IMETHOD GetWantAllTraces(bool* aAllTraces)
     {
-      *aAllTraces = mWantAllTraces;
-      return NS_OK;
+        *aAllTraces = mWantAllTraces;
+        return NS_OK;
+    }
+
+    NS_IMETHOD GetDisableLog(bool* aDisableLog)
+    {
+        *aDisableLog = mDisableLog;
+        return NS_OK;
+    }
+
+    NS_IMETHOD SetDisableLog(bool aDisableLog)
+    {
+        mDisableLog = aDisableLog;
+        return NS_OK;
+    }
+
+    NS_IMETHOD GetWantAfterProcessing(bool* aWantAfterProcessing)
+    {
+        *aWantAfterProcessing = mWantAfterProcessing;
+        return NS_OK;
+    }
+
+    NS_IMETHOD SetWantAfterProcessing(bool aWantAfterProcessing)
+    {
+        mWantAfterProcessing = aWantAfterProcessing;
+        return NS_OK;
     }
 
     NS_IMETHOD Begin()
     {
+        mCurrentAddress.AssignLiteral("0x");
+        mDescribers.Clear();
+        mNextIndex = 0;
+        if (mDisableLog) {
+            return NS_OK;
+        }
         char basename[MAXPATHLEN] = {'\0'};
         char ccname[MAXPATHLEN] = {'\0'};
 #ifdef XP_WIN
         // On Windows, tmpnam returns useless stuff, such as "\\s164.".
         // Therefore we need to call the APIs directly.
         GetTempPathA(mozilla::ArrayLength(basename), basename);
 #else
         tmpnam(basename);
@@ -1493,65 +1548,160 @@ public:
 #endif
         }
 
         return NS_OK;
     }
     NS_IMETHOD NoteRefCountedObject(PRUint64 aAddress, PRUint32 refCount,
                                     const char *aObjectDescription)
     {
-        fprintf(mStream, "%p [rc=%u] %s\n", (void*)aAddress, refCount,
-                aObjectDescription);
-
+        if (!mDisableLog) {
+            fprintf(mStream, "%p [rc=%u] %s\n", (void*)aAddress, refCount,
+                    aObjectDescription);
+        }                          
+        if (mWantAfterProcessing) {
+            CCGraphDescriber* d = mDescribers.AppendElement();
+            NS_ENSURE_TRUE(d, NS_ERROR_OUT_OF_MEMORY);
+            mCurrentAddress.AssignLiteral("0x");
+            mCurrentAddress.AppendInt(aAddress, 16);
+            d->mType = CCGraphDescriber::eRefCountedObject;
+            d->mAddress = mCurrentAddress;
+            d->mCnt = refCount;
+            d->mName.Append(aObjectDescription);
+        }                     
         return NS_OK;
     }
     NS_IMETHOD NoteGCedObject(PRUint64 aAddress, bool aMarked,
                               const char *aObjectDescription)
     {
-        fprintf(mStream, "%p [gc%s] %s\n", (void*)aAddress,
-                aMarked ? ".marked" : "", aObjectDescription);
-
+        if (!mDisableLog) {
+            fprintf(mStream, "%p [gc%s] %s\n", (void*)aAddress,
+                    aMarked ? ".marked" : "", aObjectDescription);
+        }
+        if (mWantAfterProcessing) {
+            CCGraphDescriber* d = mDescribers.AppendElement();
+            NS_ENSURE_TRUE(d, NS_ERROR_OUT_OF_MEMORY);
+            mCurrentAddress.AssignLiteral("0x");
+            mCurrentAddress.AppendInt(aAddress, 16);
+            d->mType = aMarked ? CCGraphDescriber::eGCMarkedObject :
+                                 CCGraphDescriber::eGCedObject;
+            d->mAddress = mCurrentAddress;
+            d->mName.Append(aObjectDescription);
+        }
         return NS_OK;
     }
     NS_IMETHOD NoteEdge(PRUint64 aToAddress, const char *aEdgeName)
     {
-        fprintf(mStream, "> %p %s\n", (void*)aToAddress, aEdgeName);
-
+        if (!mDisableLog) {
+            fprintf(mStream, "> %p %s\n", (void*)aToAddress, aEdgeName);
+        }
+        if (mWantAfterProcessing) {
+            CCGraphDescriber* d = mDescribers.AppendElement();
+            NS_ENSURE_TRUE(d, NS_ERROR_OUT_OF_MEMORY);
+            d->mType = CCGraphDescriber::eEdge;
+            d->mAddress = mCurrentAddress;
+            d->mToAddress.AppendInt(aToAddress, 16);
+            d->mName.Append(aEdgeName);
+        }
         return NS_OK;
     }
     NS_IMETHOD BeginResults()
     {
-        fputs("==========\n", mStream);
-
+        if (!mDisableLog) {
+            fputs("==========\n", mStream);
+        }                     
         return NS_OK;
     }
     NS_IMETHOD DescribeRoot(PRUint64 aAddress, PRUint32 aKnownEdges)
     {
-        fprintf(mStream, "%p [known=%u]\n", (void*)aAddress, aKnownEdges);
-
+        if (!mDisableLog) {
+            fprintf(mStream, "%p [known=%u]\n", (void*)aAddress, aKnownEdges);
+        }
+        if (mWantAfterProcessing) {
+            CCGraphDescriber* d = mDescribers.AppendElement();
+            NS_ENSURE_TRUE(d, NS_ERROR_OUT_OF_MEMORY);
+            d->mType = CCGraphDescriber::eRoot;
+            d->mAddress.AppendInt(aAddress, 16);
+            d->mCnt = aKnownEdges;
+        }
         return NS_OK;
     }
     NS_IMETHOD DescribeGarbage(PRUint64 aAddress)
     {
-        fprintf(mStream, "%p [garbage]\n", (void*)aAddress);
-
+        if (!mDisableLog) {
+            fprintf(mStream, "%p [garbage]\n", (void*)aAddress);
+        }
+        if (mWantAfterProcessing) {
+            CCGraphDescriber* d = mDescribers.AppendElement();
+            NS_ENSURE_TRUE(d, NS_ERROR_OUT_OF_MEMORY);
+            d->mType = CCGraphDescriber::eGarbage;
+            d->mAddress.AppendInt(aAddress, 16);
+        }
         return NS_OK;
     }
     NS_IMETHOD End()
     {
-        fclose(mStream);
-        mStream = nsnull;
-
+        if (!mDisableLog) {
+            fclose(mStream);
+            mStream = nsnull;
+        }
         return NS_OK;
     }
 
+    NS_IMETHOD ProcessNext(nsICycleCollectorHandler* aHandler,
+                           bool* aCanContinue)
+    {
+        NS_ENSURE_STATE(aHandler && mWantAfterProcessing);
+        if (mNextIndex < mDescribers.Length()) {
+            CCGraphDescriber& d = mDescribers[mNextIndex++];
+            switch (d.mType) {
+                case CCGraphDescriber::eRefCountedObject:
+                    aHandler->NoteRefCountedObject(d.mAddress,
+                                                   d.mCnt,
+                                                   d.mName);
+                    break;
+                case CCGraphDescriber::eGCedObject:
+                case CCGraphDescriber::eGCMarkedObject:
+                    aHandler->NoteGCedObject(d.mAddress,
+                                             d.mType ==
+                                               CCGraphDescriber::eGCMarkedObject,
+                                             d.mName);
+                    break;
+                case CCGraphDescriber::eEdge:
+                    aHandler->NoteEdge(d.mAddress,
+                                       d.mToAddress,
+                                       d.mName);
+                    break;
+                case CCGraphDescriber::eRoot:
+                    aHandler->DescribeRoot(d.mAddress,
+                                           d.mCnt);
+                    break;
+                case CCGraphDescriber::eGarbage:
+                    aHandler->DescribeGarbage(d.mAddress);
+                    break;
+                case CCGraphDescriber::eUnknown:
+                    NS_NOTREACHED("CCGraphDescriber::eUnknown");
+                    break;
+            }
+        }
+        if (!(*aCanContinue = mNextIndex < mDescribers.Length())) {
+            mCurrentAddress.AssignLiteral("0x");
+            mDescribers.Clear();
+            mNextIndex = 0;
+        }
+        return NS_OK;
+    }
 private:
     FILE *mStream;
     bool mWantAllTraces;
-
+    bool mDisableLog;
+    bool mWantAfterProcessing;
+    nsCString mCurrentAddress; 
+    nsTArray<CCGraphDescriber> mDescribers;
+    PRUint32 mNextIndex;
     static PRUint32 gLogCounter;
 };
 
 NS_IMPL_ISUPPORTS1(nsCycleCollectorLogger, nsICycleCollectorListener)
 
 PRUint32 nsCycleCollectorLogger::gLogCounter = 0;
 
 nsresult
--- a/xpcom/base/nsICycleCollectorListener.idl
+++ b/xpcom/base/nsICycleCollectorListener.idl
@@ -31,43 +31,68 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsISupports.idl"
 
+[scriptable, uuid(0ef15f15-7783-4991-af68-4976d7ec2267)]
+interface nsICycleCollectorHandler : nsISupports
+{
+    void noteRefCountedObject(in ACString aAddress,
+                              in unsigned long aRefCount,
+                              in ACString aObjectDescription);
+    void noteGCedObject(in ACString aAddress,
+                        in boolean aMarked,
+                        in ACString aObjectDescription);
+    void noteEdge(in ACString aFromAddress,
+                  in ACString aToAddress,
+                  in ACString aEdgeName);
+    void describeRoot(in ACString aAddress,
+                      in unsigned long aKnownEdges);
+    void describeGarbage(in ACString aAddress);
+};
+
 /** Interface to pass to the cycle collector to get information about
  * the CC graph while it's being built. The order of calls will be a
  * call to begin(); then for every node in the graph a call to either
  * noteRefCountedObject() or noteGCedObject(), followed by calls to
  * noteEdge() for every edge starting at that node; then a call to
  * beginResults(); then a mixture of describeRoot() for ref counted
  * nodes the CC has identified as roots and describeGarbage() for
  * nodes the CC has identified as garbage.  Ref counted nodes that are
  * not identified as either roots or garbage are neither, and have a
  * known edges count equal to their ref count.  Finally, there will be
  * a call to end().  If begin() returns an error none of the other
  * functions will be called.
  */
-[scriptable, builtinclass, uuid(e7e9a010-d02f-4137-94c8-6d73605fe623)]
+[scriptable, builtinclass, uuid(5d1c5d51-2022-4242-8c33-0a942b5fed06)]
 interface nsICycleCollectorListener : nsISupports
 {
     nsICycleCollectorListener allTraces();
     // false if allTraces() has not been called.
     readonly attribute boolean wantAllTraces;
 
+    // The default implementation of this interface will print out
+    // a log to a file unless disableLog is set to true.
+    attribute boolean disableLog;
+    attribute boolean wantAfterProcessing;
+
     void begin();
     void noteRefCountedObject (in unsigned long long aAddress,
 			       in unsigned long aRefCount,
 			       in string aObjectDescription);
     void noteGCedObject (in unsigned long long aAddress,
 			 in boolean aMarked,
 			 in string aObjectDescription);
     void noteEdge(in unsigned long long aToAddress,
                   in string aEdgeName);
     void beginResults();
     void describeRoot(in unsigned long long aAddress,
 		      in unsigned long aKnownEdges);
     void describeGarbage(in unsigned long long aAddress);
     void end();
+
+    // Returns false if there isn't anything more to process.
+    boolean processNext(in nsICycleCollectorHandler aHandler);
 };
--- a/xpcom/typelib/xpt/tools/xpt.py
+++ b/xpcom/typelib/xpt/tools/xpt.py
@@ -865,16 +865,17 @@ class Interface(object):
             # make sure it has a valid IID
             if self.iid == Interface.UNRESOLVED_IID:
                 raise DataError, "Cannot instantiate Interface %s containing methods or constants with an unresolved IID" % self.name
             self.resolved = True
         # These are only used for writing out the interface
         self._descriptor_offset = 0
         self._name_offset = 0
         self._namespace_offset = 0
+        self.xpt_filename = None
 
     def __repr__(self):
         return "Interface('%s', '%s', '%s', methods=%s)" % (self.name, self.iid, self.namespace, self.methods)
 
     def __str__(self):
         return "Interface(name='%s', iid='%s')" % (self.name, self.iid)
 
     def __cmp__(self, other):
@@ -1090,16 +1091,17 @@ class Typelib(object):
                 start = interface_directory_offset + i * Interface._direntry.size
                 end = interface_directory_offset + (i+1) * Interface._direntry.size
                 ide = Interface._direntry.unpack(map[start:end])
                 iid = Typelib.iid_to_string(ide[0])
                 name = Typelib.read_string(map, data_pool_offset, ide[1])
                 namespace = Typelib.read_string(map, data_pool_offset, ide[2])
                 iface = Interface(name, iid, namespace)
                 iface._descriptor_offset = ide[3]
+                iface.xpt_filename = xpt.filename
                 xpt.interfaces.append(iface)
             for iface in xpt.interfaces:
                 iface.read_descriptor(xpt, map, data_pool_offset)
         return xpt
 
     def __repr__(self):
         return "<Typelib with %d interfaces>" % len(self.interfaces)
 
@@ -1212,25 +1214,27 @@ class Typelib(object):
                             # Fixup will happen after processing all interfaces.
                         else:
                             # Same name but different IIDs: raise an exception.
                             # self.* is the (target) Typelib being merged into,
                             #   not the one which j.iid was from.
                             raise DataError, \
                                   "Typelibs contain definitions of interface %s" \
                                     " with different IIDs (%s (%s) vs %s (%s))!" % \
-                                    (i.name, i.iid, other.filename, j.iid, self.filename)
+                                    (i.name, i.iid, i.xpt_filename or other.filename, \
+                                             j.iid, j.xpt_filename or self.filename)
                 elif i.iid == j.iid and i.iid != Interface.UNRESOLVED_IID:
                     # Same IID but different names: raise an exception.
                     # self.* is the (target) Typelib being merged into,
                     #   not the one which j.name was from.
                     raise DataError, \
                           "Typelibs contain definitions of interface %s" \
                             " with different names (%s (%s) vs %s (%s))!" % \
-                            (i.iid, i.name, other.filename, j.name, self.filename)
+                            (i.iid, i.name, i.xpt_filename or other.filename, \
+                                    j.name, j.xpt_filename or self.filename)
             if not merged:
                 # No partially matching interfaces, so just take this interface
                 self.interfaces.append(i)
 
         # Now fixup any merged interfaces
         def checkType(t, replaced_from, replaced_to):
             if isinstance(t, InterfaceType) and t.iface == replaced_from:
                 t.iface = replaced_to