Merging mozilla-central to mozilla-inbound.
authorMounir Lamouri <mounir.lamouri@gmail.com>
Wed, 31 Aug 2011 17:59:12 +0200
changeset 77648 ba8bbef0fdf97da4fba62e57bbeb39150131a4db
parent 77579 bc0b3ab327fa320000405b6b0aa4e76825c3f61b (current diff)
parent 77647 8f345f65a9a043ea55932791671575e0bbfe88fd (diff)
child 77649 62f2756245c5afaa5810adfb8053a4f26fc39c79
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone9.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
Merging mozilla-central to mozilla-inbound.
js/src/jsinvoke.cpp
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -174,16 +174,17 @@
 @BINPATH@/components/htmlparser.xpt
 @BINPATH@/components/imglib2.xpt
 @BINPATH@/components/imgicon.xpt
 @BINPATH@/components/inspector.xpt
 @BINPATH@/components/intl.xpt
 @BINPATH@/components/jar.xpt
 @BINPATH@/components/jetpack.xpt
 @BINPATH@/components/jsdservice.xpt
+@BINPATH@/components/jsdebugger.xpt
 @BINPATH@/components/layout_base.xpt
 @BINPATH@/components/layout_forms.xpt
 #ifdef NS_PRINTING
 @BINPATH@/components/layout_printing.xpt
 #endif
 @BINPATH@/components/layout_xul_tree.xpt
 @BINPATH@/components/layout_xul.xpt
 @BINPATH@/components/locale.xpt
--- a/dom/src/geolocation/nsGeolocation.cpp
+++ b/dom/src/geolocation/nsGeolocation.cpp
@@ -1039,16 +1039,24 @@ nsGeolocation::WindowOwnerStillExists()
   }
 
   return PR_TRUE;
 }
 
 bool
 nsGeolocation::RegisterRequestWithPrompt(nsGeolocationRequest* request)
 {
+  if (Preferences::GetBool("geo.prompt.testing", PR_FALSE)) {
+    nsCOMPtr<nsIRunnable> ev =
+        new RequestAllowEvent(Preferences::GetBool("geo.prompt.testing.allow",
+                                                   PR_FALSE), request);
+    NS_DispatchToMainThread(ev);
+    return true;
+  }
+
   if (XRE_GetProcessType() == GeckoProcessType_Content) {
     nsCOMPtr<nsPIDOMWindow> window = do_QueryReferent(mOwner);
     if (!window)
       return true;
 
     // because owner implements nsITabChild, we can assume that it is
     // the one and only TabChild.
     TabChild* child = GetTabChildFrom(window->GetDocShell());
@@ -1061,21 +1069,13 @@ nsGeolocation::RegisterRequestWithPrompt
 
     nsCString type = NS_LITERAL_CSTRING("geolocation");
     child->SendPContentPermissionRequestConstructor(request, type, IPC::URI(mURI));
     
     request->Sendprompt();
     return true;
   }
 
-  if (Preferences::GetBool("geo.prompt.testing", PR_FALSE)) {
-    nsCOMPtr<nsIRunnable> ev =
-      new RequestAllowEvent(Preferences::GetBool("geo.prompt.testing.allow",
-                                                 PR_FALSE), request);
-    NS_DispatchToMainThread(ev);
-    return true;
-  }
-
   nsCOMPtr<nsIRunnable> ev  = new RequestPromptEvent(request);
   NS_DispatchToMainThread(ev);
   return true;
 }
 
--- a/embedding/android/AndroidManifest.xml.in
+++ b/embedding/android/AndroidManifest.xml.in
@@ -5,17 +5,17 @@
       android:installLocation="auto"
       android:versionCode="@ANDROID_VERSION_CODE@"
       android:versionName="@MOZ_APP_VERSION@"
 #ifdef MOZ_ANDROID_SHARED_ID
       android:sharedUserId="@MOZ_ANDROID_SHARED_ID@"
 #endif
       >
     <uses-sdk android:minSdkVersion="5"
-              android:targetSdkVersion="5"/>
+              android:targetSdkVersion="11"/>
 
     <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
     <uses-permission android:name="android.permission.INTERNET"/>
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
     <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
     <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
 
--- a/gfx/2d/SourceSurfaceCG.cpp
+++ b/gfx/2d/SourceSurfaceCG.cpp
@@ -105,17 +105,17 @@ SourceSurfaceCG::InitFromData(unsigned c
 
     case A8:
       // XXX: why don't we set a colorspace here?
       bitsPerComponent = 8;
       bitsPerPixel = 8;
   };
 
   void *data = malloc(aStride * aSize.height);
-  memcpy(aData, data, aStride * aSize.height);
+  memcpy(data, aData, aStride * aSize.height);
 
   mFormat = aFormat;
 
   dataProvider = CGDataProviderCreateWithData (data,
                                                data,
 					       aSize.height * aStride,
 					       releaseCallback);
 
--- a/gfx/thebes/GLContextProviderEGL.cpp
+++ b/gfx/thebes/GLContextProviderEGL.cpp
@@ -130,16 +130,17 @@ public:
 
 #else
 
 #error "Platform not recognized"
 
 #endif
 
 #include "gfxUtils.h"
+#include "gfxFailure.h"
 #include "gfxASurface.h"
 #include "gfxImageSurface.h"
 #include "gfxPlatform.h"
 #include "GLContextProvider.h"
 #include "nsDebug.h"
 #include "nsThreadUtils.h"
 #include "EGLUtils.h"
 
@@ -703,17 +704,23 @@ public:
 
     PRBool Init()
     {
         if (!OpenLibrary(GLES2_LIB)) {
             NS_WARNING("Couldn't load EGL LIB.");
             return PR_FALSE;
         }
 
-        MakeCurrent();
+        PRBool current = MakeCurrent();
+        if (!current) {
+            gfx::LogFailure(NS_LITERAL_CSTRING(
+                "Couldn't get device attachments for device."));
+            return PR_FALSE;
+        }
+
         PRBool ok = InitWithPrefix("gl", PR_TRUE);
 #if 0
         if (ok) {
             EGLint v;
             sEGLLibrary.fQueryContext(EGL_DISPLAY(), mContext, LOCAL_EGL_RENDER_BUFFER, &v);
             if (v == LOCAL_EGL_BACK_BUFFER)
                 mIsDoubleBuffered = PR_TRUE;
         }
new file mode 100644
--- /dev/null
+++ b/js/ductwork/Makefile.in
@@ -0,0 +1,49 @@
+# ***** BEGIN LICENSE BLOCK ***** 
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is the Mozilla Browser code.
+#
+# The Initial Developer of the Original Code is
+# Netscape Communications Corporation.
+# Portions created by the Initial Developer are Copyright (C) 2011
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#  Jason Orendorff <jorendorff@mozilla.com>
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# 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 *****
+
+DEPTH     = ../..
+topsrcdir = @top_srcdir@
+srcdir    = @srcdir@
+VPATH     = @srcdir@
+
+include $(topsrcdir)/config/config.mk
+
+PARALLEL_DIRS += \
+  debugger \
+  $(NULL)
+
+include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/js/ductwork/debugger/IJSDebugger.idl
@@ -0,0 +1,52 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ *   Mozilla Foundation
+ * Portions created by the Initial Developer are Copyright (C) 2011
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Dave Camp <dcamp@mozilla.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * 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 ***** */
+
+#include "nsISupports.idl"
+
+/**
+ * Do not use this interface. Instead, write:
+ *     Components.utils.import("resource://gre/modules/jsdebugger.jsm");
+ */
+[scriptable, uuid(2fc14cc6-4ed0-4bbf-a7dd-e535bf088eb5)]
+interface IJSDebugger : nsISupports
+{
+  /**
+   * Define the global Debugger constructor.
+   */
+  [implicit_jscontext]
+  void addClass();
+};
new file mode 100644
--- /dev/null
+++ b/js/ductwork/debugger/JSDebugger.cpp
@@ -0,0 +1,111 @@
+/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * The Mozilla Foundation <http://www.mozilla.org/>.
+ * Portions created by the Initial Developer are Copyright (C) 2011
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *  Dave Camp <dcamp@mozilla.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * 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 ***** */
+
+#include "JSDebugger.h"
+#include "nsIXPConnect.h"
+#include "nsThreadUtils.h"
+#include "jsapi.h"
+#include "jsobj.h"
+#include "jsgc.h"
+#include "jsfriendapi.h"
+#include "jsdbgapi.h"
+#include "mozilla/ModuleUtils.h"
+#include "nsServiceManagerUtils.h"
+#include "nsMemory.h"
+
+#define JSDEBUGGER_CONTRACTID \
+  "@mozilla.org/jsdebugger;1"
+
+#define JSDEBUGGER_CID \
+{ 0x0365cbd5, 0xd46e, 0x4e94, { 0xa3, 0x9f, 0x83, 0xb6, 0x3c, 0xd1, 0xa9, 0x63 } }
+
+namespace mozilla {
+namespace jsdebugger {
+
+NS_GENERIC_FACTORY_CONSTRUCTOR(JSDebugger)
+
+NS_IMPL_ISUPPORTS1(JSDebugger, IJSDebugger)
+
+JSDebugger::JSDebugger()
+{
+}
+
+JSDebugger::~JSDebugger()
+{
+}
+
+NS_IMETHODIMP
+JSDebugger::AddClass(JSContext *cx)
+{
+  nsresult rv;
+  nsCOMPtr<nsIXPConnect> xpc = do_GetService(nsIXPConnect::GetCID(), &rv);
+
+  JSObject* global = JS_GetGlobalForScopeChain(cx);
+  if (!global) {
+    return NS_ERROR_NOT_AVAILABLE;
+  }
+
+  if (!JS_DefineDebuggerObject(cx, global)) {
+    return NS_ERROR_FAILURE;
+  }
+
+  return NS_OK;
+}
+
+}
+}
+
+NS_DEFINE_NAMED_CID(JSDEBUGGER_CID);
+
+static const mozilla::Module::CIDEntry kJSDebuggerCIDs[] = {
+  { &kJSDEBUGGER_CID, false, NULL, mozilla::jsdebugger::JSDebuggerConstructor },
+  { NULL }
+};
+
+static const mozilla::Module::ContractIDEntry kJSDebuggerContracts[] = {
+  { JSDEBUGGER_CONTRACTID, &kJSDEBUGGER_CID },
+  { NULL }
+};
+
+static const mozilla::Module kJSDebuggerModule = {
+  mozilla::Module::kVersion,
+  kJSDebuggerCIDs,
+  kJSDebuggerContracts
+};
+
+NSMODULE_DEFN(jsdebugger) = &kJSDebuggerModule;
new file mode 100644
--- /dev/null
+++ b/js/ductwork/debugger/JSDebugger.h
@@ -0,0 +1,62 @@
+/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * The Mozilla Foundation <http://www.mozilla.org/>.
+ * Portions created by the Initial Developer are Copyright (C) 2011
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *  Dave Camp <dcamp@mozilla.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * 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 ***** */
+
+#ifndef COMPONENTS_JSDEBUGGER_H
+#define COMPONENTS_JSDEBUGGER_H
+
+#include "IJSDebugger.h"
+
+namespace mozilla {
+namespace jsdebugger {
+
+class JSDebugger : public IJSDebugger
+{
+public:
+  NS_DECL_ISUPPORTS
+  NS_DECL_IJSDEBUGGER
+
+  JSDebugger();
+
+private:
+  ~JSDebugger();
+};
+
+}
+}
+
+#endif
new file mode 100644
--- /dev/null
+++ b/js/ductwork/debugger/Makefile.in
@@ -0,0 +1,75 @@
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is mozilla.org code.
+#
+# The Initial Developer of the Original Code is
+# The Mozilla Foundation <http://www.mozilla.org/>.
+# Portions created by the Initial Developer are Copyright (C) 2011
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#  Dave Camp <dcamp@mozilla.com>
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# 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 *****
+
+DEPTH = ../../..
+topsrcdir = @top_srcdir@
+srcdir = @srcdir@
+VPATH = @srcdir@
+relativesrcdir = js/ductwork/debugger
+
+include $(DEPTH)/config/autoconf.mk
+
+MODULE = jsdebugger
+MODULE_NAME = jsdebugger
+GRE_MODULE = 1
+
+LIBRARY_NAME = jsdebugger
+XPIDL_MODULE = jsdebugger
+LIBXUL_LIBRARY = 1
+EXPORT_LIBRARY = 1
+IS_COMPONENT = 1
+
+CPPSRCS = \
+  JSDebugger.cpp \
+  $(NULL)
+
+EXTRA_DSO_LDOPTS += \
+  $(MOZ_COMPONENT_LIBS) \
+  $(MOZ_JS_LIBS) \
+  $(NULL)
+
+EXTRA_JS_MODULES = \
+  jsdebugger.jsm \
+  $(NULL)
+
+XPIDLSRCS = \
+  IJSDebugger.idl \
+  $(NULL)
+
+XPCSHELL_TESTS = tests
+
+include $(topsrcdir)/config/rules.mk
copy from toolkit/components/ctypes/ctypes.jsm
copy to js/ductwork/debugger/jsdebugger.jsm
--- a/toolkit/components/ctypes/ctypes.jsm
+++ b/js/ductwork/debugger/jsdebugger.jsm
@@ -11,46 +11,45 @@
  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  * for the specific language governing rights and limitations under the
  * License.
  *
  * The Original Code is js-ctypes.
  *
  * The Initial Developer of the Original Code is
  * The Mozilla Foundation <http://www.mozilla.org/>.
- * Portions created by the Initial Developer are Copyright (C) 2009
+ * Portions created by the Initial Developer are Copyright (C) 2011
  * the Initial Developer. All Rights Reserved.
  *
  * Contributor(s):
- *  Dan Witte <dwitte@mozilla.com>
+ *  Jason Orendorff <jorendorff@mozilla.com>
  *
  * Alternatively, the contents of this file may be used under the terms of
  * either the GNU General Public License Version 2 or later (the "GPL"), or
  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  * in which case the provisions of the GPL or the LGPL are applicable instead
  * of those above. If you wish to allow use of your version of this file only
  * under the terms of either the GPL or the LGPL, and not to allow others to
  * 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 ***** */
 
-let EXPORTED_SYMBOLS = [ "ctypes" ];
+let EXPORTED_SYMBOLS = [ "Debugger" ];
 
 /*
- * This is the js module for ctypes. Import it like so:
- *   Components.utils.import("resource://gre/modules/ctypes.jsm");
+ * This is the js module for Debugger. Import it like so:
+ *   Components.utils.import("resource://gre/modules/jsdebugger.jsm");
  *
- * This will create a 'ctypes' object, which provides an interface to describe
- * and instantiate C types and call C functions from a dynamic library.
+ * This will create a 'Debugger' object, which provides an interface to debug
+ * JavaScript code running in other compartments in the same process, on the
+ * same thread.
  *
  * For documentation on the API, see:
- * https://developer.mozilla.org/en/js-ctypes/js-ctypes_reference
- *
+ *   https://wiki.mozilla.org/Debugger
  */
 
-// Initialize the ctypes object. You do not need to do this yourself.
-const init = Components.classes["@mozilla.org/jsctypes;1"].createInstance();
-init();
-
+// Initialize the Debugger object. You do not need to do this yourself.
+const init = Components.classes["@mozilla.org/jsdebugger;1"].createInstance(Components.interfaces.IJSDebugger);
+init.addClass();
new file mode 100644
--- /dev/null
+++ b/js/ductwork/debugger/tests/head_dbg.js
@@ -0,0 +1,17 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+const Cc = Components.classes;
+const Ci = Components.interfaces;
+const Cu = Components.utils;
+const Cr = Components.results;
+
+function testGlobal(aName) {
+  let systemPrincipal = Cc["@mozilla.org/systemprincipal;1"]
+    .createInstance(Ci.nsIPrincipal);
+
+  let sandbox = Cu.Sandbox(systemPrincipal);
+  Cu.evalInSandbox("this.__name = '" + aName + "'", sandbox);
+  return sandbox;
+}
new file mode 100644
--- /dev/null
+++ b/js/ductwork/debugger/tests/test_nativewrappers.js
@@ -0,0 +1,29 @@
+function run_test()
+{
+  Components.utils.import("resource://gre/modules/jsdebugger.jsm");
+  var g = testGlobal("test1");
+
+  var dbg = new Debugger();
+  dbg.addDebuggee(g);
+  dbg.onDebuggerStatement = function(aFrame) {
+    let args = aFrame["arguments"];
+    try {
+      args[0];
+      do_check_true(true);
+    } catch(ex) {
+      do_check_true(false);
+    }
+  };
+
+  g.eval("function stopMe(arg) {debugger;}");
+
+  g2 = testGlobal("test2");
+  g2.g = g;
+  g2.eval("(" + function createBadEvent() {
+    let parser = Components.classes["@mozilla.org/xmlextras/domparser;1"].createInstance(Components.interfaces.nsIDOMParser);
+    let doc = parser.parseFromString("<foo></foo>", "text/xml");
+    g.stopMe(doc.createEvent("MouseEvent"));
+  } + ")()");
+
+  dbg.enabled = false;
+}
new file mode 100644
--- /dev/null
+++ b/js/ductwork/debugger/tests/xpcshell.ini
@@ -0,0 +1,5 @@
+[DEFAULT]
+head = head_dbg.js
+tail =
+
+[test_nativewrappers.js]
--- a/js/src/Makefile.in
+++ b/js/src/Makefile.in
@@ -119,17 +119,16 @@ CPPSRCS		= \
 		jsgc.cpp \
 		jsgcmark.cpp \
 		jsgcchunk.cpp \
 		jsgcstats.cpp \
 		jscrashreport.cpp \
 		jshash.cpp \
 		jsinfer.cpp \
 		jsinterp.cpp \
-		jsinvoke.cpp \
 		jsiter.cpp \
 		jslock.cpp \
 		jslog2.cpp \
 		jsmath.cpp \
 		jsnativestack.cpp \
 		jsnum.cpp \
 		jsobj.cpp \
 		json.cpp \
--- a/js/src/jsfun.cpp
+++ b/js/src/jsfun.cpp
@@ -1168,30 +1168,16 @@ call_resolve(JSContext *cx, JSObject *ob
     /* Control flow reaches here only if id was not resolved. */
     return true;
 }
 
 static void
 call_trace(JSTracer *trc, JSObject *obj)
 {
     JS_ASSERT(obj->isCall());
-    if (StackFrame *fp = obj->maybeCallObjStackFrame()) {
-        /*
-         * FIXME: Hide copies of stack values rooted by fp from the Cycle
-         * Collector, which currently lacks a non-stub Unlink implementation
-         * for JS objects (including Call objects), so is unable to collect
-         * cycles involving Call objects whose frames are active without this
-         * hiding hack.
-         */
-        uintN first = JSObject::CALL_RESERVED_SLOTS;
-        uintN count = fp->script()->bindings.countArgsAndVars();
-
-        JS_ASSERT(obj->numSlots() >= first + count);
-        obj->clearSlotRange(first, count);
-    }
 
     MaybeMarkGenerator(trc, obj);
 }
 
 JS_PUBLIC_DATA(Class) js_CallClass = {
     "Call",
     JSCLASS_HAS_PRIVATE |
     JSCLASS_HAS_RESERVED_SLOTS(JSObject::CALL_RESERVED_SLOTS) |
--- a/js/src/jsinterp.cpp
+++ b/js/src/jsinterp.cpp
@@ -105,19 +105,16 @@
 #if defined(JS_METHODJIT) && defined(JS_MONOIC)
 #include "methodjit/MonoIC.h"
 #endif
 
 using namespace js;
 using namespace js::gc;
 using namespace js::types;
 
-/* jsinvoke_cpp___ indicates inclusion from jsinvoke.cpp. */
-#if !JS_LONE_INTERPRET ^ defined jsinvoke_cpp___
-
 JSObject *
 js::GetScopeChain(JSContext *cx)
 {
     /*
      * Note: we don't need to expand inline frames here, because frames are
      * only inlined when the caller and callee share the same scope chain.
      */
     StackFrame *fp = js_GetTopStackFrame(cx, FRAME_EXPAND_NONE);
@@ -1317,17 +1314,17 @@ ValueToId(JSContext *cx, const Value &v,
 }
 
 } /* namespace js */
 
 /*
  * Enter the new with scope using an object at sp[-1] and associate the depth
  * of the with block with sp + stackIndex.
  */
-JS_STATIC_INTERPRET JS_REQUIRES_STACK JSBool
+JS_REQUIRES_STACK JSBool
 js_EnterWith(JSContext *cx, jsint stackIndex, JSOp op, size_t oplen)
 {
     StackFrame *fp = cx->fp();
     Value *sp = cx->regs().sp;
     JS_ASSERT(stackIndex < 0);
     JS_ASSERT(fp->base() <= sp + stackIndex);
 
     JSObject *obj;
@@ -1352,17 +1349,17 @@ js_EnterWith(JSContext *cx, jsint stackI
                                          sp + stackIndex - fp->base());
     if (!withobj)
         return JS_FALSE;
 
     fp->setScopeChainNoCallObj(*withobj);
     return JS_TRUE;
 }
 
-JS_STATIC_INTERPRET JS_REQUIRES_STACK void
+JS_REQUIRES_STACK void
 js_LeaveWith(JSContext *cx)
 {
     JSObject *withobj;
 
     withobj = &cx->fp()->scopeChain();
     JS_ASSERT(withobj->getClass() == &js_WithClass);
     JS_ASSERT(withobj->getPrivate() == js_FloatingFrameIfGenerator(cx, cx->fp()));
     JS_ASSERT(OBJ_BLOCK_DEPTH(cx, withobj) >= 0);
@@ -1408,17 +1405,17 @@ js_UnwindScope(JSContext *cx, jsint stac
             js_LeaveWith(cx);
         }
     }
 
     cx->regs().sp = fp->base() + stackDepth;
     return normalUnwind;
 }
 
-JS_STATIC_INTERPRET JSBool
+JSBool
 js_DoIncDec(JSContext *cx, const JSCodeSpec *cs, Value *vp, Value *vp2)
 {
     if (cs->format & JOF_POST) {
         double d;
         if (!ToNumber(cx, *vp, &d))
             return JS_FALSE;
         vp->setNumber(d);
         (cs->format & JOF_INC) ? ++d : --d;
@@ -1470,20 +1467,16 @@ js::FindUpvarFrame(JSContext *cx, uintN 
         JS_ASSERT(fp && fp->isScriptFrame());
         if (fp->script()->staticLevel == targetLevel)
             break;
         fp = fp->prev();
     }
     return fp;
 }
 
-#endif /* !JS_LONE_INTERPRET ^ defined jsinvoke_cpp___ */
-
-#ifndef  jsinvoke_cpp___
-
 #define PUSH_COPY(v)             do { *regs.sp++ = v; assertSameCompartment(cx, regs.sp[-1]); } while (0)
 #define PUSH_COPY_SKIP_CHECK(v)  *regs.sp++ = v
 #define PUSH_NULL()              regs.sp++->setNull()
 #define PUSH_UNDEFINED()         regs.sp++->setUndefined()
 #define PUSH_BOOLEAN(b)          regs.sp++->setBoolean(b)
 #define PUSH_DOUBLE(d)           regs.sp++->setDouble(d)
 #define PUSH_INT32(i)            regs.sp++->setInt32(i)
 #define PUSH_STRING(s)           do { regs.sp++->setString(s); assertSameCompartment(cx, regs.sp[-1]); } while (0)
@@ -6366,10 +6359,8 @@ END_CASE(JSOP_ARRAYPUSH)
         JSAutoByteString printable;
         if (js_AtomToPrintableString(cx, atomNotDefined, &printable))
             js_ReportIsNotDefined(cx, printable.ptr());
     }
     goto error;
 }
 
 } /* namespace js */
-
-#endif /* !defined jsinvoke_cpp___ */
--- a/js/src/jsinterp.h
+++ b/js/src/jsinterp.h
@@ -357,56 +357,31 @@ class InterpreterFrames {
   private:
     JSContext *context;
     FrameRegs *regs;
     const InterruptEnablerBase &enabler;
 };
 
 } /* namespace js */
 
-/*
- * JS_LONE_INTERPRET indicates that the compiler should see just the code for
- * the js_Interpret function when compiling jsinterp.cpp. The rest of the code
- * from the file should be visible only when compiling jsinvoke.cpp. It allows
- * platform builds to optimize selectively js_Interpret when the granularity
- * of the optimizations with the given compiler is a compilation unit.
- *
- * JS_STATIC_INTERPRET is the modifier for functions defined in jsinterp.cpp
- * that only js_Interpret calls. When JS_LONE_INTERPRET is true all such
- * functions are declared below.
- */
-#ifndef JS_LONE_INTERPRET
-# ifdef _MSC_VER
-#  define JS_LONE_INTERPRET 0
-# else
-#  define JS_LONE_INTERPRET 1
-# endif
-#endif
-
-#if !JS_LONE_INTERPRET
-# define JS_STATIC_INTERPRET    static
-#else
-# define JS_STATIC_INTERPRET
-
 extern JS_REQUIRES_STACK JSBool
 js_EnterWith(JSContext *cx, jsint stackIndex, JSOp op, size_t oplen);
 
 extern JS_REQUIRES_STACK void
 js_LeaveWith(JSContext *cx);
 
 /*
  * Find the results of incrementing or decrementing *vp. For pre-increments,
  * both *vp and *vp2 will contain the result on return. For post-increments,
  * vp will contain the original value converted to a number and vp2 will get
  * the result. Both vp and vp2 must be roots.
  */
 extern JSBool
 js_DoIncDec(JSContext *cx, const JSCodeSpec *cs, js::Value *vp, js::Value *vp2);
 
-#endif /* JS_LONE_INTERPRET */
 /*
  * Unwind block and scope chains to match the given depth. The function sets
  * fp->sp on return to stackDepth.
  */
 extern JS_REQUIRES_STACK JSBool
 js_UnwindScope(JSContext *cx, jsint stackDepth, JSBool normalUnwind);
 
 extern JSBool
deleted file mode 100644
--- a/js/src/jsinvoke.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * vim: set ts=8 sw=4 et tw=78:
- *
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Mozilla SpiderMonkey JavaScript 1.8 code, released
- * March 4, 2008.
- *
- * The Initial Developer of the Original Code is
- *   Igor Bukanov <igor@mir2.org>
- *
- * Contributor(s):
- *   Brendan Eich <brendan@mozilla.org
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * 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 ***** */
-
-#define jsinvoke_cpp___
-
-#include "jsinterp.cpp"
--- a/js/src/jsparse.cpp
+++ b/js/src/jsparse.cpp
@@ -2471,17 +2471,17 @@ Parser::setFunctionKinds(JSFunctionBox *
 
         JS_ASSERT(fun->kind() == JSFUN_INTERPRETED);
 
         if (funbox->tcflags & TCF_FUN_HEAVYWEIGHT) {
             /* nothing to do */
         } else if (funbox->inAnyDynamicScope()) {
             JS_ASSERT(!fun->isNullClosure());
         } else {
-            uintN hasUpvars = false;
+            bool hasUpvars = false;
             bool canFlatten = true;
 
             if (pn->pn_type == TOK_UPVARS) {
                 AtomDefnMapPtr upvars = pn->pn_names;
                 JS_ASSERT(!upvars->empty());
 
                 /*
                  * For each lexical dependency from this closure to an outer
--- a/layout/mathml/nsMathMLmactionFrame.cpp
+++ b/layout/mathml/nsMathMLmactionFrame.cpp
@@ -377,17 +377,17 @@ ShowStatus(nsPresContext* aPresContext, 
 NS_IMETHODIMP
 nsMathMLmactionFrame::MouseListener::HandleEvent(nsIDOMEvent* aEvent)
 {
   nsAutoString eventType;
   aEvent->GetType(eventType);
   if (eventType.EqualsLiteral("mouseover")) {
     mOwner->MouseOver();
   }
-  else if (eventType.EqualsLiteral("mouseclick")) {
+  else if (eventType.EqualsLiteral("click")) {
     mOwner->MouseClick();
   }
   else if (eventType.EqualsLiteral("mouseout")) {
     mOwner->MouseOut();
   }
   else {
     NS_ABORT();
   }
--- a/mobile/app/mobile.js
+++ b/mobile/app/mobile.js
@@ -395,17 +395,17 @@ pref("javascript.options.mem.high_water_
 pref("javascript.options.gc_on_memory_pressure", false);
 
 pref("dom.max_chrome_script_run_time", 0); // disable slow script dialog for chrome
 pref("dom.max_script_run_time", 20);
 
 // JS error console
 pref("devtools.errorconsole.enabled", false);
 
-pref("browser.ui.layout.tablet", 0); // on: 1, off: 0, auto: -1
+pref("browser.ui.layout.tablet", -1); // on: 1, off: 0, auto: -1
 
 // kinetic tweakables
 pref("browser.ui.kinetic.updateInterval", 16);
 pref("browser.ui.kinetic.exponentialC", 1400);
 pref("browser.ui.kinetic.polynomialC", 100);
 pref("browser.ui.kinetic.swipeLength", 160);
 
 // zooming
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..32bfc5e8f97422fc2f7a7d45c24d4a5bc3302523
GIT binary patch
literal 160
zc${<cUBCbV3P8*QrWF_%fe;A(|Nqa(wF1cCU|?X<U|?`yVd&rx;$UP5Xi!j6b#Zla
zSs@@8;N_|s8l|YTL`zF+N!O%RleAQptqNVWYa!RFt6p5;+g5NzU0Kw$`rQhxZ8tp`
z?&qy^+MP9t<Nnqlr+u%MFx=l8G~w5(B@F-H1~uGUHA(3IuM-VlS50F0_cmz3|65BK
E0J3g6q5uE@
--- a/modules/libpr0n/test/reftest/bmp/bmp-1bpp/reftest.list
+++ b/modules/libpr0n/test/reftest/bmp/bmp-1bpp/reftest.list
@@ -12,9 +12,10 @@
 == bmp-size-9x9-1bpp.bmp   bmp-size-9x9-1bpp.png
 == bmp-size-15x15-1bpp.bmp bmp-size-15x15-1bpp.png
 == bmp-size-16x16-1bpp.bmp bmp-size-16x16-1bpp.png
 == bmp-size-17x17-1bpp.bmp bmp-size-17x17-1bpp.png
 == bmp-size-31x31-1bpp.bmp bmp-size-31x31-1bpp.png
 == bmp-size-32x32-1bpp.bmp bmp-size-32x32-1bpp.png
 == bmp-size-33x33-1bpp.bmp bmp-size-33x33-1bpp.png
 == bmp-not-square-1bpp.bmp bmp-not-square-1bpp.png
-
+== os2bmp-size-32x32-1bpp.bmp bmp-size-32x32-1bpp.png
+== top-to-bottom-16x16-1bpp.bmp bmp-size-16x16-1bpp.png
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..8633ef2aaa14468abac0cf2b09319e552fc3d248
GIT binary patch
literal 126
zc${<ctz&=yJ0R8oVgVrj@c;jRMg~T(xC0O$;e%jg093;8YXJkpy$%L2eQN>(!@ETc
r3{^n-8j#)vq(fa97`#?7FnBsKFmP%yFerF2FtCI$FmQkj0O|n%JTn<;
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..b75ae62ca8a3dec024b0bf4e7f7cabb69ff3a7e0
GIT binary patch
literal 3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E_4!WBwi)wWfHF-F5p5!yg*_h
zb)KDxxy*U`<1xcrO)$QuS68?^$2h_`q~jsEJjVDC<9#yT!&Q%rT{3=`jBPS*W8B1*
ziSc8MYZz-7tK_mw#tOzV#!F<JCztbNJjYye_b$`Fe#wwzf+Rt5iR1#;5t8R5IYlzS
zM*$KaiHD?zYZr+_k}V`Hl2}MgBnCdxk*pzE#dR6U3b~d^@{nBTNg^Q0k|e`iv#D!_
zx&0qHc}Z@6NhiOclMk8OpV7%r>Fqz$$q(r5_sQgYbn=g6@*Xq!TYCG~%;YUPX_DJ-
vGLt{0lRu`nU!{{T)7#hR<nwg$S?1<<naQW=<hPm0C+OrpGnrv-e(iq&smZL|
--- a/modules/libpr0n/test/reftest/bmp/bmp-24bpp/reftest.list
+++ b/modules/libpr0n/test/reftest/bmp/bmp-24bpp/reftest.list
@@ -12,9 +12,10 @@
 == bmp-size-9x9-24bpp.bmp   bmp-size-9x9-24bpp.png
 == bmp-size-15x15-24bpp.bmp bmp-size-15x15-24bpp.png
 == bmp-size-16x16-24bpp.bmp bmp-size-16x16-24bpp.png
 == bmp-size-17x17-24bpp.bmp bmp-size-17x17-24bpp.png
 == bmp-size-31x31-24bpp.bmp bmp-size-31x31-24bpp.png
 == bmp-size-32x32-24bpp.bmp bmp-size-32x32-24bpp.png
 == bmp-size-33x33-24bpp.bmp bmp-size-33x33-24bpp.png
 == bmp-not-square-24bpp.bmp bmp-not-square-24bpp.png
-
+== os2bmp-size-32x32-24bpp.bmp bmp-size-32x32-24bpp.png
+== top-to-bottom-16x16-24bpp.bmp bmp-size-16x16-24bpp.png
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..bd18f85d485b6330584fe4470a776ee82109c010
GIT binary patch
literal 822
zc$_uKJ#5@$9DwovYu|_ML>1JptFn<hyUKd$*+pzMvH6e~$Z@tnOg-gXm90tcO(iB0
z@meZdDE5Ka0%r$xEIpqhCL;A5Dz-|og9HmwZPa%0#bF5%6_50r9{qidh5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Pf9v_A|^o@55VI!FW|w4X0|@<MHTu
zJ&f1){c!4s72>Ym-Q7k}G)+M#A;c!C-|Wk2?7XP!+J__=Z~qPbru55l8jsTydM$Rl
zeeK_tQJikK8T5R!nk0S^Pt)u)ZXB?$1HVj0f96>xxWH)tX_B19qtQ6aG{%_oNe~1{
z92eV}5E?6vSF7T0QOvTL1_1H=XZSt;J)g5z!5hvwM!{LRn6nwvy5Wf998JFbc!&!o
zlmie7(c)sw7;~>F?0k5YFTiU}U5_r;>j&r?tQtze=i&J|Bu%3o4mupzz2j+vlmpNu
zS>H3Qv_cBCgplxX@yIOjih@YketmM@8AJ#|?csU3Y^Zx)Db>0wSI<@{OFM!HZCm-c
zWZEhNiBZJq+Y|H(8AFKaS_y!q)<pod9U*dQEu{*2BMp&~NM&sY9~xx{e9=nit+9?Z
U(#g8Mvt1|Mt-%A*freWC2UL&(-v9sr
--- a/modules/libpr0n/test/reftest/bmp/bmp-4bpp/reftest.list
+++ b/modules/libpr0n/test/reftest/bmp/bmp-4bpp/reftest.list
@@ -12,9 +12,10 @@
 == bmp-size-9x9-4bpp.bmp   bmp-size-9x9-4bpp.png
 == bmp-size-15x15-4bpp.bmp bmp-size-15x15-4bpp.png
 == bmp-size-16x16-4bpp.bmp bmp-size-16x16-4bpp.png
 == bmp-size-17x17-4bpp.bmp bmp-size-17x17-4bpp.png
 == bmp-size-31x31-4bpp.bmp bmp-size-31x31-4bpp.png
 == bmp-size-32x32-4bpp.bmp bmp-size-32x32-4bpp.png
 == bmp-size-33x33-4bpp.bmp bmp-size-33x33-4bpp.png
 == bmp-not-square-4bpp.bmp bmp-not-square-4bpp.png
-
+== os2bmp-size-32x32-4bpp.bmp bmp-size-32x32-4bpp.png
+== top-to-bottom-16x16-4bpp.bmp  bmp-size-16x16-4bpp.png
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..c77696b325a8e98c987774b59c8d7eeeb191b53d
GIT binary patch
literal 246
zc$_tfp$@_@5Qa-akOZ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ci&ANa#t|Dn-%TKVzX
zuh;&d_D?IuCnqOggCD_f;4SzYTwIJi^u$E%UybzJqtti43aES?aCGz_AAaI>r4cal
zM;DhD-&K4ICZ?vQegdzywzhr;N5{v<mzQ@Qdg?hm^wuUk^zpmL{(0>;Yya-n&rZ!i
zBVgn=Yd=>p3ueF*@H5!i+}YedIXM{{`_xZEgYE6qW6kDVa}+T%JJQqBwcj53X7gr+
zT2IeI@4^pme0StKH-3J8XBPp3LHcgy&(3wK{PsxC@9qwExBG*^pxbSBli5zE({4X$
zw_B~&!ovIl{Gi_-^t&~k%2yg5Ah!>?_W~YxMC|SD^}DNhy4_x<)9b8s+RLrwR%>Zt
z0iT68gExEq)T{XP(yz2vTFVGof?q@cSgq;xdMn8?SOSYl`m4KuULA1j5%5SaKgb7H
e;8FUm9}X9X_x#Ge<!e8z{O1<9@t<FRIQ$=3q?%Iz
--- a/modules/libpr0n/test/reftest/bmp/bmp-8bpp/reftest.list
+++ b/modules/libpr0n/test/reftest/bmp/bmp-8bpp/reftest.list
@@ -12,9 +12,10 @@
 == bmp-size-9x9-8bpp.bmp   bmp-size-9x9-8bpp.png
 == bmp-size-15x15-8bpp.bmp bmp-size-15x15-8bpp.png
 == bmp-size-16x16-8bpp.bmp bmp-size-16x16-8bpp.png
 == bmp-size-17x17-8bpp.bmp bmp-size-17x17-8bpp.png
 == bmp-size-31x31-8bpp.bmp bmp-size-31x31-8bpp.png
 == bmp-size-32x32-8bpp.bmp bmp-size-32x32-8bpp.png
 == bmp-size-33x33-8bpp.bmp bmp-size-33x33-8bpp.png
 == bmp-not-square-8bpp.bmp bmp-not-square-8bpp.png
-
+== os2bmp-size-32x32-8bpp.bmp bmp-size-32x32-8bpp.png
+== top-to-bottom-16x16-8bpp.bmp  bmp-size-16x16-8bpp.png
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..bb60249ac853eaf89f44ed492c5e2dfb3f42213a
GIT binary patch
literal 1334
zc${6*Jx>%-6vpvO5Mss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test/reftest/bmp/bmp-corrupted/reftest.list
+++ b/modules/libpr0n/test/reftest/bmp/bmp-corrupted/reftest.list
@@ -1,11 +1,12 @@
 # Corrupted BMP tests
 
 == wrapper.html?invalid-signature.bmp about:blank
 == wrapper.html?invalid-bpp.bmp about:blank
+== wrapper.html?os2-invalid-bpp.bmp about:blank
 # Tests for an unsupported compression value
 == wrapper.html?invalid-compression.bmp about:blank
 # Tests for RLE4 with an invalid BPP
 == wrapper.html?invalid-compression-RLE4.bmp about:blank
 # Tests for RLE8 with an invalid BPP
 == wrapper.html?invalid-compression-RLE8.bmp about:blank
 
--- a/other-licenses/android/APKOpen.cpp
+++ b/other-licenses/android/APKOpen.cpp
@@ -286,16 +286,17 @@ extractFile(const char * path, const str
     __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Couldn't open %s to decompress library", path);
     return;
   }
 
   void * buf = mmap(NULL, 4096, PROT_READ | PROT_WRITE,
                     MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
   if (buf == (void *)-1) {
     __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Couldn't mmap decompression buffer");
+    close(fd);
     return;
   }
 
   z_stream strm = {
     next_in: (Bytef *)data,
     avail_in: letoh32(entry->compressed_size),
     total_in: 0,
 
@@ -505,20 +506,22 @@ static void * mozload(const char * path,
       fd = open(fullpath, O_RDWR | O_CREAT);
       if (fd < 0) {
         __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Couldn't create a file either, giving up");
         return NULL;
       }
       // we'd like to use fallocate here, but it doesn't exist currently?
       if (lseek(fd, lib_size - 1, SEEK_SET) == (off_t) - 1) {
          __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "seeking file failed");
+        close(fd);
         return NULL;
       }
       if (write(fd, "", 1) != 1) {
         __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "writting one byte to the file failed");
+        close(fd);
         return NULL;
       }
       skipLibCache = true;
       addLibCacheFd(path + 4, fd);
     }
     buf = mmap(NULL, lib_size,
                PROT_READ | PROT_WRITE,
                MAP_SHARED, fd, 0);
--- a/testing/xpcshell/xpcshell.ini
+++ b/testing/xpcshell/xpcshell.ini
@@ -41,16 +41,17 @@ skip-if = os == "android"
 [include:testing/xpcshell/example/unit/xpcshell.ini]
 [include:xpcom/tests/unit/xpcshell.ini]
 [include:modules/libpref/test/unit/xpcshell.ini]
 [include:intl/strres/tests/unit/xpcshell.ini]
 [include:intl/unicharutil/tests/unit/xpcshell.ini]
 [include:intl/uconv/tests/unit/xpcshell.ini]
 [include:netwerk/test/unit/xpcshell.ini]
 [include:netwerk/test/httpserver/test/xpcshell.ini]
+[include:js/ductwork/debugger/tests/xpcshell.ini]
 [include:js/jetpack/tests/unit/xpcshell.ini]
 [include:js/src/xpconnect/tests/unit/xpcshell.ini]
 [include:modules/libjar/test/unit/xpcshell.ini]
 [include:extensions/cookie/test/unit/xpcshell.ini]
 [include:storage/test/unit/xpcshell.ini]
 [include:rdf/tests/unit/xpcshell.ini]
 [include:gfx/tests/unit/xpcshell.ini]
 [include:widget/tests/unit/xpcshell.ini]
--- a/toolkit/components/places/AsyncFaviconHelpers.cpp
+++ b/toolkit/components/places/AsyncFaviconHelpers.cpp
@@ -854,17 +854,17 @@ AsyncAssociateIconToPage::Run()
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 //// AsyncGetFaviconURLForPage
 
 // static
 nsresult
-AsyncGetFaviconURLForPage::start(nsIURI *aPageURI,
+AsyncGetFaviconURLForPage::start(nsIURI* aPageURI,
                                  nsCOMPtr<mozIStorageConnection>& aDBConn,
                                  nsIFaviconDataCallback* aCallback)
 {
   NS_ENSURE_ARG(aCallback);
   NS_ENSURE_ARG(aPageURI);
   NS_PRECONDITION(NS_IsMainThread(),
                   "This should be called on the main thread.");
 
@@ -923,16 +923,93 @@ AsyncGetFaviconURLForPage::Run()
                             mFaviconSvc, mCallback);
   rv = NS_DispatchToMainThread(event);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
+//// AsyncGetFaviconDataForPage
+
+// static
+nsresult
+AsyncGetFaviconDataForPage::start(nsIURI* aPageURI,
+                                  nsCOMPtr<mozIStorageConnection>& aDBConn,
+                                  nsIFaviconDataCallback* aCallback)
+{
+  NS_ENSURE_ARG(aCallback);
+  NS_ENSURE_ARG(aPageURI);
+  NS_PRECONDITION(NS_IsMainThread(),
+                  "This should be called on the main thread.");
+
+  nsRefPtr<nsFaviconService> fs = nsFaviconService::GetFaviconService();
+  NS_ENSURE_TRUE(fs, NS_ERROR_OUT_OF_MEMORY);
+
+  nsCAutoString pageSpec;
+  nsresult rv = aPageURI->GetSpec(pageSpec);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  nsCOMPtr<nsIFaviconDataCallback> callback = aCallback;
+  nsRefPtr<AsyncGetFaviconDataForPage> event =
+    new AsyncGetFaviconDataForPage(pageSpec, aDBConn, fs, callback);
+
+  nsCOMPtr<nsIEventTarget> target = do_GetInterface(aDBConn);
+  NS_ENSURE_TRUE(target, NS_ERROR_OUT_OF_MEMORY);
+  rv = target->Dispatch(event, NS_DISPATCH_NORMAL);
+  NS_ENSURE_SUCCESS(rv, rv);
+  return NS_OK;
+}
+
+AsyncGetFaviconDataForPage::AsyncGetFaviconDataForPage(const nsACString& aPageSpec, 
+                                                       nsCOMPtr<mozIStorageConnection>& aDBConn, 
+                                                       nsRefPtr<nsFaviconService>& aFaviconSvc, 
+                                                       nsCOMPtr<nsIFaviconDataCallback>& aCallback)
+  : AsyncFaviconHelperBase(aDBConn, aFaviconSvc, aCallback)
+{
+  mPageSpec.Assign(aPageSpec);
+}
+
+AsyncGetFaviconDataForPage::~AsyncGetFaviconDataForPage()
+{
+}
+
+NS_IMETHODIMP
+AsyncGetFaviconDataForPage::Run()
+{
+  NS_PRECONDITION(!NS_IsMainThread(),
+                  "This should not be called on the main thread.");
+
+  nsCAutoString iconSpec;
+  nsresult rv = FetchIconURL(mFaviconSvc->mSyncStatements,
+                             mPageSpec, iconSpec);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  if (!iconSpec.Length()) {
+    return NS_ERROR_NOT_AVAILABLE;
+  }
+
+  IconData iconData;
+  iconData.spec.Assign(iconSpec);
+
+  PageData pageData;
+  pageData.spec.Assign(mPageSpec);
+
+  rv = FetchIconInfo(mFaviconSvc->mSyncStatements, iconData);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  nsCOMPtr<nsIRunnable> event =
+    new NotifyIconObservers(iconData, pageData, mDBConn,
+                            mFaviconSvc, mCallback);
+  rv = NS_DispatchToMainThread(event);
+  NS_ENSURE_SUCCESS(rv, rv);
+  return NS_OK;
+}
+
+////////////////////////////////////////////////////////////////////////////////
 //// NotifyIconObservers
 
 NotifyIconObservers::NotifyIconObservers(
   IconData& aIcon
 , PageData& aPage
 , nsCOMPtr<mozIStorageConnection>& aDBConn
 , nsRefPtr<nsFaviconService>& aFaviconSvc
 , nsCOMPtr<nsIFaviconDataCallback>& aCallback
--- a/toolkit/components/places/AsyncFaviconHelpers.h
+++ b/toolkit/components/places/AsyncFaviconHelpers.h
@@ -309,16 +309,63 @@ public:
                             nsCOMPtr<nsIFaviconDataCallback>& aCallback);
 
   virtual ~AsyncGetFaviconURLForPage();
 
 private:
   nsCString mPageSpec;
 };
 
+
+/**
+ * Asynchronously tries to get the URL and data of a page's favicon.  
+ * If this succeeds, notifies the given observer.
+ */
+class AsyncGetFaviconDataForPage : public AsyncFaviconHelperBase
+{
+public:
+  NS_DECL_NSIRUNNABLE
+
+  /**
+   * Creates the event and dispatches it to the I/O thread.
+   *
+   * @param aPageURI
+   *        URL of the page whose favicon URL and data we're fetching
+   * @param aDBConn
+   *        database connection to use
+   * @param aCallback
+   *        function to be called once the URL and data is retrieved from the database
+   */
+  static nsresult start(nsIURI* aPageURI,
+                        nsCOMPtr<mozIStorageConnection>& aDBConn,
+                        nsIFaviconDataCallback* aCallback);
+
+  /**
+   * Constructor.
+   *
+   * @param aPageSpec
+   *        URL of the page whose favicon URL and data we're fetching
+   * @param aDBConn
+   *        database connection to use
+   * @param aFaviconSvc
+   *        the favicon service to query
+   * @param aCallback
+   *        function to be called once the URL is retrieved from the database
+   */
+  AsyncGetFaviconDataForPage(const nsACString& aPageSpec,
+                             nsCOMPtr<mozIStorageConnection>& aDBConn,
+                             nsRefPtr<nsFaviconService>& aFaviconSvc,
+                             nsCOMPtr<nsIFaviconDataCallback>& aCallback);
+
+  virtual ~AsyncGetFaviconDataForPage();
+
+private:
+  nsCString mPageSpec;
+};
+
 /**
  * Notifies the icon change to favicon observers.
  */
 class NotifyIconObservers : public AsyncFaviconHelperBase
 {
 public:
   NS_DECL_NSIRUNNABLE
 
--- a/toolkit/components/places/mozIAsyncFavicons.idl
+++ b/toolkit/components/places/mozIAsyncFavicons.idl
@@ -42,17 +42,17 @@ interface nsIURI;
 interface nsIFaviconDataCallback;
 
 /**
  * Interface for accessing the favicon service asynchronously.
  *
  * @status EXPERIMENTAL
  */
 
-[scriptable, uuid(6D2B0507-245F-452D-9718-5595DCD3CD14)]
+[scriptable, uuid(0cb4e536-e120-41e6-998f-66123d81ec53)]
 interface mozIAsyncFavicons : nsISupports
 {
   /**
    * Declares that a given page uses a favicon with the given URI and 
    * attempts to fetch and save the icon data by loading the favicon URI
    * through an async network request.
    *
    * If the icon data already exists, we won't try to reload the icon unless
@@ -101,9 +101,23 @@ interface mozIAsyncFavicons : nsISupport
    *        Once we've found the favicon's URL, we invoke this callback.  Note
    *        that the callback's aDataLen will be 0, aData will be null, and
    *        aMimeType will be empty -- only aURI will be non-zero/null/empty.
    *
    * @see nsIFaviconDataCallback in nsIFaviconService.idl.
    */
   void getFaviconURLForPage(in nsIURI aPageURI,
                             in nsIFaviconDataCallback aCallback);
+
+  /**
+   * Retrieve the URL and data of the favicon for the given page.
+   *
+   * @param aPageURI
+   *        URI of the page whose favicon's URL and data we're looking up
+   * @param aCallback
+   *        Once we've found the favicon's URL, we invoke this callback with
+   *        the favicon data.
+   *
+   * @see nsIFaviconDataCallback in nsIFaviconService.idl.
+   */
+  void getFaviconDataForPage(in nsIURI aPageURI,
+                             in nsIFaviconDataCallback aCallback);
 };
--- a/toolkit/components/places/nsFaviconService.cpp
+++ b/toolkit/components/places/nsFaviconService.cpp
@@ -713,16 +713,27 @@ nsFaviconService::GetFaviconURLForPage(n
   NS_ENSURE_ARG(aPageURI);
   NS_ENSURE_ARG(aCallback);
 
   nsresult rv = AsyncGetFaviconURLForPage::start(aPageURI, mDBConn, aCallback);
   NS_ENSURE_SUCCESS(rv, rv);
   return NS_OK;
 }
 
+NS_IMETHODIMP
+nsFaviconService::GetFaviconDataForPage(nsIURI* aPageURI,
+                                        nsIFaviconDataCallback* aCallback)
+{
+  NS_ENSURE_ARG(aPageURI);
+  NS_ENSURE_ARG(aCallback);
+
+  nsresult rv = AsyncGetFaviconDataForPage::start(aPageURI, mDBConn, aCallback);
+  NS_ENSURE_SUCCESS(rv, rv);
+  return NS_OK;
+}
 
 NS_IMETHODIMP
 nsFaviconService::GetFaviconImageForPage(nsIURI* aPageURI, nsIURI** _retval)
 {
   NS_ENSURE_ARG(aPageURI);
   NS_ENSURE_ARG_POINTER(_retval);
 
   DECLARE_AND_ASSIGN_SCOPED_LAZY_STMT(stmt, mDBGetURL);
--- a/toolkit/components/places/tests/unit/test_favicons.js
+++ b/toolkit/components/places/tests/unit/test_favicons.js
@@ -336,16 +336,26 @@ var savedIcon1URI = iconsvc.getFaviconFo
 // Test getFaviconForPage().
 do_test_pending();
 iconsvc.getFaviconURLForPage(page1URI, {
     onFaviconDataAvailable: function(aURI, aDataLen, aData, aMimeType) {
       do_check_true(aURI.equals(savedIcon1URI));
       do_check_eq(aDataLen, 0);
       do_check_eq(aData.length, 0);
       do_check_eq(aMimeType, "");
+  },
+  QueryInterface: XPCOMUtils.generateQI([Ci.nsIFaviconDataCallback])
+});
+
+iconsvc.getFaviconDataForPage(page1URI, {
+    onFaviconDataAvailable: function(aURI, aDataLen, aData, aMimeType) {
+      do_check_true(aURI.equals(savedIcon1URI));
+      do_check_eq(icon1MimeType, out1MimeType.value);
+      checkArrays(icon1Data, aData);
+      do_check_eq(aDataLen, aData.length);
       do_test_finished();
   },
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIFaviconDataCallback])
 });
 
 // set second page icon
 try {
   iconsvc.setFaviconData(icon2URI, icon2Data, icon2Data.length,
--- a/toolkit/library/libxul-config.mk
+++ b/toolkit/library/libxul-config.mk
@@ -137,16 +137,17 @@ COMPONENT_LIBS += \
 	toolkitcomps \
 	pipboot \
 	pipnss \
 	appcomps \
 	jsreflect \
 	composer \
 	jetpack_s \
 	telemetry \
+	jsdebugger \
 	storagecomps \
 	$(NULL)
 
 ifdef BUILD_CTYPES
 COMPONENT_LIBS += \
 	jsctypes \
 	$(NULL)
 endif
--- a/toolkit/library/nsStaticXULComponents.cpp
+++ b/toolkit/library/nsStaticXULComponents.cpp
@@ -268,16 +268,17 @@
     OSXPROXY_MODULE                          \
     WINDOWSPROXY_MODULE                      \
     JSCTYPES_MODULE                          \
     JSREFLECT_MODULE                         \
     MODULE(jsperf)                           \
     SERVICES_CRYPTO_MODULE                   \
     MOZ_APP_COMPONENT_MODULES                \
     MODULE(nsTelemetryModule)                \
+    MODULE(jsdebugger)                       \
     /* end of list */
 
 #define MODULE(_name) \
   NSMODULE_DECL(_name);
 
 XUL_MODULES
 
 #undef MODULE
--- a/toolkit/toolkit-makefiles.sh
+++ b/toolkit/toolkit-makefiles.sh
@@ -678,16 +678,22 @@ MAKEFILES_jsctypes="
   toolkit/components/ctypes/Makefile
   toolkit/components/ctypes/tests/Makefile
 "
 
 MAKEFILES_jsreflect="
   toolkit/components/reflect/Makefile
 "
 
+MAKEFILES_jsductwork="
+  js/ductwork/Makefile
+  js/ductwork/debugger/Makefile
+  js/ductwork/debugger/tests/Makefile
+"
+
 MAKEFILES_libpr0n="
   modules/libpr0n/Makefile
   modules/libpr0n/build/Makefile
   modules/libpr0n/public/Makefile
   modules/libpr0n/src/Makefile
   modules/libpr0n/decoders/Makefile
   modules/libpr0n/decoders/icon/Makefile
   modules/libpr0n/decoders/icon/mac/Makefile
@@ -745,16 +751,17 @@ add_makefiles "
   $MAKEFILES_gfx
   $MAKEFILES_htmlparser
   $MAKEFILES_intl
   $MAKEFILES_xpconnect
   $MAKEFILES_jsipc
   $MAKEFILES_jsdebugger
   $MAKEFILES_jsctypes
   $MAKEFILES_jsreflect
+  $MAKEFILES_jsductwork
   $MAKEFILES_content
   $MAKEFILES_layout
   $MAKEFILES_libimg
   $MAKEFILES_libjar
   $MAKEFILES_libreg
   $MAKEFILES_libpref
   $MAKEFILES_mathml
   $MAKEFILES_plugin
--- a/toolkit/toolkit-tiers.mk
+++ b/toolkit/toolkit-tiers.mk
@@ -219,16 +219,18 @@ endif
 ifdef MOZ_PREF_EXTENSIONS
 tier_platform_dirs += extensions/pref
 endif
 
 tier_platform_dirs += services/crypto/component
 
 tier_platform_dirs += startupcache
 
+tier_platform_dirs += js/ductwork
+
 ifdef APP_LIBXUL_STATICDIRS
 # Applications can cheat and ask for code to be
 # built before libxul so libxul can be linked against it.
 tier_platform_staticdirs += $(APP_LIBXUL_STATICDIRS)
 endif
 ifdef APP_LIBXUL_DIRS
 # Applications can cheat and ask for code to be
 # built before libxul so it can be linked into libxul.
--- a/xpcom/glue/nsISupportsImpl.h
+++ b/xpcom/glue/nsISupportsImpl.h
@@ -170,17 +170,17 @@ public:
       refcount = NS_CCAR_TAGGED_TO_REFCNT(mTagged);
       ++refcount;
       mTagged = NS_CCAR_REFCNT_TO_TAGGED(refcount);
     }
 
     return refcount;
   }
 
-  void stabilizeForDeletion(nsISupports *owner)
+  void stabilizeForDeletion(nsISupports*)
   {
     mTagged = NS_CCAR_TAGGED_STABILIZED_REFCNT;
   }
 
   nsrefcnt decr(nsISupports *owner)
   {
     if (NS_UNLIKELY(mTagged == NS_CCAR_TAGGED_STABILIZED_REFCNT))
       return 1;