Merge m-c to autoland, a=merge
authorWes Kocher <wkocher@mozilla.com>
Thu, 15 Sep 2016 16:42:10 -0700
changeset 314141 d8a383370502b41992775dc4efc2501453c14170
parent 314140 854e74094d8cf43e8a00f953e09a3068a2c18e25 (current diff)
parent 314134 3b871b737c616c89a4b46398b800974b455c0960 (diff)
child 314142 cdab1a072387f67420d5bc90a4993c89ac6b9d73
push id30708
push usercbook@mozilla.com
push dateFri, 16 Sep 2016 10:52:07 +0000
treeherdermozilla-central@3172114c06cd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone51.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 m-c to autoland, a=merge
browser/base/content/browser.js
browser/themes/windows/toolbarbutton-dropdown-arrow.png
devtools/client/debugger/new/test/mochitest/examples/doc-script-switching-01.html
dom/interfaces/html/nsIDOMMediaError.idl
--- a/.eslintignore
+++ b/.eslintignore
@@ -187,32 +187,32 @@ devtools/client/debugger/test/mochitest/
 devtools/client/debugger/test/mochitest/code_math_bogus_map.js
 devtools/client/debugger/test/mochitest/code_ugly*
 devtools/client/debugger/test/mochitest/code_worker-source-map.js
 devtools/client/framework/test/code_ugly*
 devtools/server/tests/unit/babel_and_browserify_script_with_source_map.js
 devtools/server/tests/unit/setBreakpoint*
 
 # mobile/android/ exclusions
-mobile/android/chrome/content
 mobile/android/tests/
 
 # Uses `#filter substitution`
 mobile/android/b2gdroid/app/b2gdroid.js
 mobile/android/app/mobile.js
 mobile/android/chrome/content/healthreport-prefs.js
 
 # Uses `#expand`
 mobile/android/chrome/content/about.js
 
 # Not much JS to lint and non-standard at that
 mobile/android/installer/
 mobile/android/locales/
 
 # Non-standard `(catch ex if ...)`
+mobile/android/chrome/content/browser.js
 mobile/android/components/Snippets.js
 
 # Bug 1178739: Ignore this file as a quick fix for "Illegal yield expression"
 mobile/android/modules/HomeProvider.jsm
 
 # services/ exclusions
 
 # Uses `#filter substitution`
--- a/accessible/generic/DocAccessible.cpp
+++ b/accessible/generic/DocAccessible.cpp
@@ -1373,17 +1373,33 @@ DocAccessible::ProcessInvalidationList()
   // Invalidate children of container accessible for each element in
   // invalidation list. Allow invalidation list insertions while container
   // children are recached.
   for (uint32_t idx = 0; idx < mInvalidationList.Length(); idx++) {
     nsIContent* content = mInvalidationList[idx];
     if (!HasAccessible(content)) {
       Accessible* container = GetContainerAccessible(content);
       if (container) {
-        ProcessContentInserted(container, content);
+        // Check if the node is a target of aria-owns, and if so, don't process
+        // it here and let DoARIAOwnsRelocation process it.
+        AttrRelProviderArray* list =
+          mDependentIDsHash.Get(nsDependentAtomString(content->GetID()));
+        bool shouldProcess = !!list;
+        if (shouldProcess) {
+          for (uint32_t idx = 0; idx < list->Length(); idx++) {
+            if (list->ElementAt(idx)->mRelAttr == nsGkAtoms::aria_owns) {
+              shouldProcess = false;
+              break;
+            }
+          }
+
+          if (shouldProcess) {
+            ProcessContentInserted(container, content);
+          }
+        }
       }
     }
   }
 
   mInvalidationList.Clear();
 }
 
 Accessible*
--- a/accessible/tests/mochitest/events/a11y.ini
+++ b/accessible/tests/mochitest/events/a11y.ini
@@ -4,16 +4,17 @@ support-files =
   focus.html
   scroll.html
   !/accessible/tests/mochitest/*.js
   !/accessible/tests/mochitest/letters.gif
 
 [test_aria_alert.html]
 [test_aria_menu.html]
 [test_aria_objattr.html]
+[test_aria_owns.html]
 [test_aria_statechange.html]
 [test_attrs.html]
 [test_caretmove.html]
 [test_caretmove.xul]
 [test_coalescence.html]
 [test_contextmenu.html]
 [test_descrchange.html]
 [test_docload.html]
new file mode 100644
--- /dev/null
+++ b/accessible/tests/mochitest/events/test_aria_owns.html
@@ -0,0 +1,129 @@
+<html>
+
+<head>
+  <title>Aria-owns targets shouldn't be on invalidation list so shouldn't have
+         show/hide events</title>
+
+  <link rel="stylesheet" type="text/css"
+        href="chrome://mochikit/content/tests/SimpleTest/test.css" />
+
+  <script type="application/javascript"
+          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="application/javascript"
+          src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
+
+  <script type="application/javascript"
+          src="../common.js"></script>
+  <script type="application/javascript"
+          src="../states.js"></script>
+  <script type="application/javascript"
+          src="../events.js"></script>
+
+  <script type="application/javascript">
+
+    ////////////////////////////////////////////////////////////////////////////
+    // Do tests.
+
+    //gA11yEventDumpToConsole = true; // debug stuff
+    //enableLogging("tree,eventTree,verbose");
+
+    /**
+     * Aria-owns target shouldn't have a show event.
+     * Markup:
+     * <div id="t1_fc" aria-owns="t1_owns"></div>
+     * <span id="t1_owns"></div>
+     */
+    function testAriaOwns()
+    {
+      this.parent = getNode("t1");
+      this.fc = document.createElement("div");
+      this.fc.setAttribute("id", "t1_fc");
+      this.owns = document.createElement("span");
+      this.owns.setAttribute("id", "t1_owns");
+
+      this.eventSeq = [
+        new invokerChecker(EVENT_SHOW, this.fc),
+        new unexpectedInvokerChecker(EVENT_SHOW, this.owns)
+      ];
+
+      this.invoke = function testAriaOwns_invoke()
+      {
+        getNode("t1").appendChild(this.fc);
+        getNode("t1").appendChild(this.owns);
+        getNode("t1_fc").setAttribute("aria-owns", "t1_owns");
+      };
+
+      this.getID = function testAriaOwns_getID() {
+        return "Aria-owns target shouldn't have show event";
+      };
+    }
+
+    /**
+     * Target of both aria-owns and other aria attribute like aria-labelledby
+     * shouldn't have a show event.
+     * Markup:
+     * <div id="t2_fc" aria-owns="t1_owns"></div>
+     * <div id="t2_sc" aria-labelledby="t2_owns"></div>
+     * <span id="t2_owns"></div>
+     */
+    function testAriaOwnsAndLabelledBy()
+    {
+      this.parent = getNode("t2");
+      this.fc = document.createElement("div");
+      this.fc.setAttribute("id", "t2_fc");
+      this.sc = document.createElement("div");
+      this.sc.setAttribute("id", "t2_sc");
+      this.owns = document.createElement("span");
+      this.owns.setAttribute("id", "t2_owns");
+
+      this.eventSeq = [
+        new invokerChecker(EVENT_SHOW, this.fc),
+        new invokerChecker(EVENT_SHOW, this.sc),
+        new unexpectedInvokerChecker(EVENT_SHOW, this.owns)
+      ];
+
+      this.invoke = function testAriaOwns_invoke()
+      {
+        getNode("t2").appendChild(this.fc);
+        getNode("t2").appendChild(this.sc);
+        getNode("t2").appendChild(this.owns);
+        getNode("t2_fc").setAttribute("aria-owns", "t2_owns");
+        getNode("t2_sc").setAttribute("aria-labelledby", "t2_owns");
+      };
+
+      this.getID = function testAriaOwns_getID() {
+        return "Aria-owns and aria-labelledby target shouldn't have show event";
+      };
+    }
+
+    var gQueue = null;
+    function doTests()
+    {
+      gQueue = new eventQueue();
+      gQueue.push(new testAriaOwns());
+      gQueue.push(new testAriaOwnsAndLabelledBy());
+
+      gQueue.invoke(); // Will call SimpleTest.finish();
+    }
+    SimpleTest.waitForExplicitFinish();
+    addA11yLoadEvent(doTests);
+  </script>
+</head>
+
+<body>
+
+  <a target="_blank"
+     href="https://bugzilla.mozilla.org/show_bug.cgi?id=1296420"
+     title="Aria-owns targets shouldn't be on invalidation list so shouldn't
+            have show/hide events">
+    Mozilla Bug 1296420
+  </a><br>
+
+  <div id="testContainer">
+    <div id="t1"></div>
+
+    <div id="t2"></div>
+  </div>
+
+</body>
+</html>
--- a/browser/app/moz.build
+++ b/browser/app/moz.build
@@ -28,16 +28,19 @@ LOCAL_INCLUDES += [
     '/xpcom/base',
     '/xpcom/build',
 ]
 
 USE_LIBS += [
     'mozglue',
 ]
 
+if CONFIG['LIBFUZZER']:
+  USE_LIBS += [ 'fuzzer' ]
+
 if CONFIG['_MSC_VER']:
     # Always enter a Windows program through wmain, whether or not we're
     # a console application.
     WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     RCINCLUDE = 'splash.rc'
     DEFINES['MOZ_PHOENIX'] = True
--- a/browser/app/nsBrowserApp.cpp
+++ b/browser/app/nsBrowserApp.cpp
@@ -122,33 +122,52 @@ XRE_TelemetryAccumulateType XRE_Telemetr
 XRE_StartupTimelineRecordType XRE_StartupTimelineRecord;
 XRE_mainType XRE_main;
 XRE_StopLateWriteChecksType XRE_StopLateWriteChecks;
 XRE_XPCShellMainType XRE_XPCShellMain;
 XRE_GetProcessTypeType XRE_GetProcessType;
 XRE_SetProcessTypeType XRE_SetProcessType;
 XRE_InitChildProcessType XRE_InitChildProcess;
 XRE_EnableSameExecutableForContentProcType XRE_EnableSameExecutableForContentProc;
+#ifdef LIBFUZZER
+XRE_LibFuzzerSetMainType XRE_LibFuzzerSetMain;
+XRE_LibFuzzerGetFuncsType XRE_LibFuzzerGetFuncs;
+#endif
 
 static const nsDynamicFunctionLoad kXULFuncs[] = {
     { "XRE_GetFileFromPath", (NSFuncPtr*) &XRE_GetFileFromPath },
     { "XRE_CreateAppData", (NSFuncPtr*) &XRE_CreateAppData },
     { "XRE_FreeAppData", (NSFuncPtr*) &XRE_FreeAppData },
     { "XRE_TelemetryAccumulate", (NSFuncPtr*) &XRE_TelemetryAccumulate },
     { "XRE_StartupTimelineRecord", (NSFuncPtr*) &XRE_StartupTimelineRecord },
     { "XRE_main", (NSFuncPtr*) &XRE_main },
     { "XRE_StopLateWriteChecks", (NSFuncPtr*) &XRE_StopLateWriteChecks },
     { "XRE_XPCShellMain", (NSFuncPtr*) &XRE_XPCShellMain },
     { "XRE_GetProcessType", (NSFuncPtr*) &XRE_GetProcessType },
     { "XRE_SetProcessType", (NSFuncPtr*) &XRE_SetProcessType },
     { "XRE_InitChildProcess", (NSFuncPtr*) &XRE_InitChildProcess },
     { "XRE_EnableSameExecutableForContentProc", (NSFuncPtr*) &XRE_EnableSameExecutableForContentProc },
+#ifdef LIBFUZZER
+    { "XRE_LibFuzzerSetMain", (NSFuncPtr*) &XRE_LibFuzzerSetMain },
+    { "XRE_LibFuzzerGetFuncs", (NSFuncPtr*) &XRE_LibFuzzerGetFuncs },
+#endif
     { nullptr, nullptr }
 };
 
+#ifdef LIBFUZZER
+int libfuzzer_main(int argc, char **argv);
+
+/* This wrapper is used by the libFuzzer main to call into libxul */
+
+void libFuzzerGetFuncs(const char* moduleName, LibFuzzerInitFunc* initFunc,
+                       LibFuzzerTestingFunc* testingFunc) {
+  return XRE_LibFuzzerGetFuncs(moduleName, initFunc, testingFunc);
+}
+#endif
+
 static int do_main(int argc, char* argv[], char* envp[], nsIFile *xreDirectory)
 {
   nsCOMPtr<nsIFile> appini;
   nsresult rv;
   uint32_t mainFlags = 0;
 
   // Allow firefox.exe to launch XULRunner apps via -app <application.ini>
   // Note that -app must be the *first* argument.
@@ -249,16 +268,21 @@ static int do_main(int argc, char* argv[
   if (!brokerServices) {
     Output("Couldn't initialize the broker services.\n");
     return 255;
   }
 #endif
   appData.sandboxBrokerServices = brokerServices;
 #endif
 
+#ifdef LIBFUZZER
+  if (getenv("LIBFUZZER"))
+    XRE_LibFuzzerSetMain(argc, argv, libfuzzer_main);
+#endif
+
   return XRE_main(argc, argv, &appData, mainFlags);
 }
 
 static bool
 FileExists(const char *path)
 {
 #ifdef XP_WIN
   wchar_t wideDir[MAX_PATH];
--- a/browser/base/content/test/general/browser.ini
+++ b/browser/base/content/test/general/browser.ini
@@ -350,16 +350,17 @@ support-files = feed_discovery.html
 skip-if = buildapp == 'mulet' # Bug 1066070 - I don't think either popup notifications nor addon install stuff works?
 support-files = test_offline_gzip.html gZipOfflineChild.cacheManifest gZipOfflineChild.cacheManifest^headers^ gZipOfflineChild.html gZipOfflineChild.html^headers^
 [browser_overflowScroll.js]
 [browser_pageInfo.js]
 skip-if = buildapp == 'mulet'
 [browser_page_style_menu.js]
 [browser_page_style_menu_update.js]
 [browser_parsable_css.js]
+skip-if = debug # no point in running on both opt and debug, and will likely intermittently timeout on debug
 [browser_parsable_script.js]
 skip-if = asan || (os == 'linux' && !debug && (bits == 32)) # disabled on asan because of timeouts, and bug 1172468 for the linux 32-bit pgo issue.
 [browser_permissions.js]
 support-files =
   permissions.html
 [browser_pinnedTabs.js]
 [browser_plainTextLinks.js]
 [browser_popupUI.js]
--- a/browser/base/content/test/general/browser_parsable_css.js
+++ b/browser/base/content/test/general/browser_parsable_css.js
@@ -28,16 +28,48 @@ let whitelist = [
    errorMessage: /Unknown pseudo-class.*moz-native-anonymous/i,
    isFromDevTools: true},
   // Responsive Design Mode CSS uses a UA-only pseudo-class, see Bug 1241714.
   {sourceName: /responsive-ua\.css$/i,
    errorMessage: /Unknown pseudo-class.*moz-dropdown-list/i,
    isFromDevTools: true},
 ];
 
+// Platform can be "linux", "macosx" or "win". If omitted, the exception applies to all platforms.
+let allowedImageReferences = [
+  // Bug 1302759
+  {file: "chrome://browser/skin/customizableui/customize-titleBar-toggle.png",
+   from: "chrome://browser/skin/browser.css",
+   platforms: ["linux"],
+   isFromDevTools: false},
+  {file: "chrome://browser/skin/customizableui/customize-titleBar-toggle@2x.png",
+   from: "chrome://browser/skin/browser.css",
+   platforms: ["linux"],
+   isFromDevTools: false},
+
+  // Bug 1302691
+  {file: "chrome://devtools/skin/images/dock-bottom-minimize@2x.png",
+   from: "chrome://devtools/skin/toolbox.css",
+   isFromDevTools: true},
+  {file: "chrome://devtools/skin/images/dock-bottom-maximize@2x.png",
+   from: "chrome://devtools/skin/toolbox.css",
+   isFromDevTools: true},
+
+  // Bug 1302708
+  {file: "chrome/devtools/modules/devtools/client/themes/images/filter.svg",
+   from: "chrome/devtools/modules/devtools/client/themes/common.css",
+   isFromDevTools: true},
+
+  // Bug 1302890
+  {file: "chrome://global/skin/icons/warning-32.png",
+   from: "chrome://devtools/skin/tooltips.css",
+   platforms: ["linux", "win"],
+   isFromDevTools: true},
+];
+
 var moduleLocation = gTestPath.replace(/\/[^\/]*$/i, "/parsingTestHelpers.jsm");
 var {generateURIsFromDirTree} = Cu.import(moduleLocation, {});
 
 // Add suffix to stylesheets' URI so that we always load them here and
 // have them parsed. Add a random number so that even if we run this
 // test multiple times, it would be unlikely to affect each other.
 const kPathSuffix = "?always-parse-css-" + Math.random();
 
@@ -158,16 +190,75 @@ function messageIsCSSError(msg) {
       ok(false, `Got error message for ${sourceName}: ${msg.errorMessage}`);
       return true;
     }
     info(`Ignored error for ${sourceName} because of filter.`);
   }
   return false;
 }
 
+let imageURIsToReferencesMap = new Map();
+
+function processCSSRules(sheet) {
+  for (let rule of sheet.cssRules) {
+    if (rule instanceof CSSMediaRule) {
+      processCSSRules(rule);
+      continue;
+    }
+    if (!(rule instanceof CSSStyleRule))
+      continue;
+
+    // Extract urls from the css text.
+    // Note: CSSStyleRule.cssText always has double quotes around URLs even
+    //       when the original CSS file didn't.
+    let urls = rule.cssText.match(/url\("[^"]*"\)/g);
+    if (!urls)
+      continue;
+
+    for (let url of urls) {
+      // Remove the url(" prefix and the ") suffix.
+      url = url.replace(/url\("(.*)"\)/, "$1");
+      if (url.startsWith("data:"))
+        continue;
+
+      // Make the url absolute and remove the ref.
+      let baseURI = Services.io.newURI(rule.parentStyleSheet.href, null, null);
+      url = Services.io.newURI(url, null, baseURI).specIgnoringRef;
+
+      // Store the image url along with the css file referencing it.
+      let baseUrl = baseURI.spec.split("?always-parse-css")[0];
+      if (!imageURIsToReferencesMap.has(url)) {
+        imageURIsToReferencesMap.set(url, new Set([baseUrl]));
+      } else {
+        imageURIsToReferencesMap.get(url).add(baseUrl);
+      }
+    }
+  }
+}
+
+function chromeFileExists(aURI)
+{
+  let available = 0;
+  try {
+    let channel = NetUtil.newChannel({uri: aURI, loadUsingSystemPrincipal: true});
+    let stream = channel.open();
+    let sstream = Cc["@mozilla.org/scriptableinputstream;1"]
+                    .createInstance(Ci.nsIScriptableInputStream);
+    sstream.init(stream);
+    available = sstream.available();
+    sstream.close();
+  } catch (e) {
+    if (e.result != Components.results.NS_ERROR_FILE_NOT_FOUND) {
+      dump("Checking " + aURI + ": " + e + "\n");
+      Cu.reportError(e);
+    }
+  }
+  return available > 0;
+}
+
 add_task(function* checkAllTheCSS() {
   let appDir = Services.dirsvc.get("XCurProcD", Ci.nsIFile);
   // This asynchronously produces a list of URLs (sadly, mostly sync on our
   // test infrastructure because it runs against jarfiles there, and
   // our zipreader APIs are all sync)
   let uris = yield generateURIsFromDirTree(appDir, [".css", ".manifest"]);
 
   // Create a clean iframe to load all the files into. This needs to live at a
@@ -204,16 +295,17 @@ add_task(function* checkAllTheCSS() {
   let devtoolsPathBits = ["webide", "devtools"];
   uris = uris.filter(uri => isDevtools == devtoolsPathBits.some(path => uri.spec.includes(path)));
 
   for (let uri of uris) {
     let linkEl = doc.createElement("link");
     linkEl.setAttribute("rel", "stylesheet");
     let promiseForThisSpec = Promise.defer();
     let onLoad = (e) => {
+      processCSSRules(linkEl.sheet);
       promiseForThisSpec.resolve();
       linkEl.removeEventListener("load", onLoad);
       linkEl.removeEventListener("error", onError);
     };
     let onError = (e) => {
       ok(false, "Loading " + linkEl.getAttribute("href") + " threw an error!");
       promiseForThisSpec.resolve();
       linkEl.removeEventListener("load", onLoad);
@@ -226,31 +318,62 @@ add_task(function* checkAllTheCSS() {
     linkEl.setAttribute("href", chromeUri.spec + kPathSuffix);
     allPromises.push(promiseForThisSpec.promise);
     doc.head.appendChild(linkEl);
   }
 
   // Wait for all the files to have actually loaded:
   yield Promise.all(allPromises);
 
+  // Check if all the files referenced from CSS actually exist.
+  for (let [image, references] of imageURIsToReferencesMap) {
+    if (!chromeFileExists(image)) {
+      for (let ref of references) {
+        let ignored = false;
+        for (let item of allowedImageReferences) {
+          if (image.endsWith(item.file) && ref.endsWith(item.from) &&
+              isDevtools == item.isFromDevTools &&
+              (!item.platforms || item.platforms.includes(AppConstants.platform))) {
+            item.used = true;
+            ignored = true;
+            break;
+          }
+        }
+        if (!ignored)
+          ok(false, "missing " + image + " referenced from " + ref);
+      }
+    }
+  }
+
   let messages = Services.console.getMessageArray();
   // Count errors (the test output will list actual issues for us, as well
   // as the ok(false) in messageIsCSSError.
   let errors = messages.filter(messageIsCSSError);
   is(errors.length, 0, "All the styles (" + allPromises.length + ") loaded without errors.");
 
   // Confirm that all whitelist rules have been used.
   for (let item of whitelist) {
     if (!item.used && isDevtools == item.isFromDevTools) {
       ok(false, "Unused whitelist item. " +
                 (item.sourceName ? " sourceName: " + item.sourceName : "") +
                 (item.errorMessage ? " errorMessage: " + item.errorMessage : ""));
     }
   }
 
+  // Confirm that all file whitelist rules have been used.
+  for (let item of allowedImageReferences) {
+    if (!item.used && isDevtools == item.isFromDevTools &&
+        (!item.platforms || item.platforms.includes(AppConstants.platform))) {
+      ok(false, "Unused file whitelist item. " +
+                " file: " + item.file +
+                " from: " + item.from);
+    }
+  }
+
   // Clean up to avoid leaks:
   iframe.remove();
   doc.head.innerHTML = '';
   doc = null;
   iframe = null;
   windowless.close();
   windowless = null;
+  imageURIsToReferencesMap = null;
 });
--- a/browser/components/extensions/test/browser/browser_ext_tabs_onUpdated.js
+++ b/browser/components/extensions/test/browser/browser_ext_tabs_onUpdated.js
@@ -82,28 +82,26 @@ add_task(function* () {
     extension.awaitFinish("tabs.onUpdated"),
   ]);
 
   yield extension.unload();
 
   yield BrowserTestUtils.closeWindow(win1);
 });
 
-function* do_test_update(background) {
+function* do_test_update(background, withPermissions = true) {
   let win1 = yield BrowserTestUtils.openNewBrowserWindow();
 
   yield focusWindow(win1);
 
-  let extension = ExtensionTestUtils.loadExtension({
-    manifest: {
-      "permissions": ["tabs"],
-    },
-
-    background: background,
-  });
+  let manifest = {};
+  if (withPermissions) {
+    manifest.permissions = ["tabs"];
+  }
+  let extension = ExtensionTestUtils.loadExtension({manifest, background});
 
   yield Promise.all([
     yield extension.startup(),
     yield extension.awaitFinish("finish"),
   ]);
 
   yield extension.unload();
 
@@ -172,9 +170,28 @@ add_task(function* test_url() {
           return;
         }
       });
       browser.tabs.update(tab.id, {url: "about:blank"});
     });
   });
 });
 
+add_task(function* test_without_tabs_permission() {
+  yield do_test_update(function background() {
+    browser.tabs.create({url: "about:blank"}, function(tab) {
+      browser.tabs.onUpdated.addListener(function onUpdated(tabId, changeInfo) {
+        if (tabId == tab.id) {
+          browser.test.assertFalse("url" in changeInfo, "url should not be included without tabs permission");
+          browser.test.assertFalse("favIconUrl" in changeInfo, "favIconUrl should not be included without tabs permission");
+
+          if (changeInfo.status == "complete") {
+            browser.tabs.onUpdated.removeListener(onUpdated);
+            browser.tabs.remove(tabId);
+            browser.test.notifyPass("finish");
+          }
+        }
+      });
+    });
+  }, false /* withPermissions */);
+});
+
 add_task(forceGC);
--- a/browser/components/preferences/in-content/privacy.xul
+++ b/browser/components/preferences/in-content/privacy.xul
@@ -272,17 +272,17 @@
             accesskey="&locbar.history.accesskey;"
             preference="browser.urlbar.suggest.history"/>
   <checkbox id="bookmarkSuggestion" label="&locbar.bookmarks.label;"
             accesskey="&locbar.bookmarks.accesskey;"
             preference="browser.urlbar.suggest.bookmark"/>
   <checkbox id="openpageSuggestion" label="&locbar.openpage.label;"
             accesskey="&locbar.openpage.accesskey;"
             preference="browser.urlbar.suggest.openpage"/>
-  <label class="text-link" onclick="if (event.button == 0) gotoPref('search')">
+  <label class="text-link" onclick="gotoPref('search')">
     &suggestionSettings.label;
   </label>
 </groupbox>
 
 <!-- Containers -->
 <groupbox id="browserContainersGroup" data-category="panePrivacy" hidden="true">
   <vbox id="browserContainersbox" hidden="true">
     <caption><label>&browserContainersHeader.label;
--- a/browser/locales/en-US/chrome/browser/browser.properties
+++ b/browser/locales/en-US/chrome/browser/browser.properties
@@ -722,17 +722,17 @@ certErrorDetailsHSTS.label = HTTP Strict
 certErrorDetailsKeyPinning.label = HTTP Public Key Pinning: %S
 certErrorDetailsCertChain.label = Certificate chain:
 
 # LOCALIZATION NOTE (tabgroups.migration.anonGroup):
 # %S is the group number/ID
 tabgroups.migration.anonGroup = Group %S
 tabgroups.migration.tabGroupBookmarkFolderName = Bookmarked Tab Groups
 
-# LOCALIZATION NOTE (pendingCrashReports.label): Semi-colon list of plural forms
+# LOCALIZATION NOTE (pendingCrashReports2.label): Semi-colon list of plural forms
 # See: http://developer.mozilla.org/en/docs/Localization_and_Plurals
 # #1 is the number of pending crash reports
 pendingCrashReports2.label = You have an unsent crash report;You have #1 unsent crash reports
 pendingCrashReports.viewAll = View
 pendingCrashReports.send = Send
 pendingCrashReports.alwaysSend = Always Send
 
 decoder.noCodecs.button = Learn how
--- a/browser/themes/shared/customizableui/customizeMode.inc.css
+++ b/browser/themes/shared/customizableui/customizeMode.inc.css
@@ -58,75 +58,80 @@
 }
 
 /* Most target outlines are shown on hover and drag over but the panel menu uses
    placeholders instead. */
 #main-window[customize-entered] .customization-target:not(:-moz-any(#PanelUI-contents, #TabsToolbar, #toolbar-menubar)):hover::before,
 #main-window[customize-entered] .customization-target[customizing-dragovertarget]:not(:-moz-any(#PanelUI-contents, #TabsToolbar, #toolbar-menubar))::before,
 /* nav-bar and panel outlines are always shown */
 #nav-bar[showoutline=true] > #nav-bar-customization-target.customization-target::before {
-  outline-color: rgb(102,102,102);
+  outline-color: currentColor;
 }
 
 #nav-bar[showoutline=true] > #nav-bar-customization-target.customization-target::before {
   transition: outline-color 250ms linear;
 }
 
 #PanelUI-contents[showoutline=true] > .panel-customization-placeholder {
   transition: outline-color 250ms linear;
-  outline-color: #bbb;
+  outline-color: var(--panel-separator-color);
 }
 
 #PanelUI-contents > .panel-customization-placeholder {
   cursor: auto;
   outline-offset: -5px;
 }
 
 #main-window[customizing] .customization-target:not(#PanelUI-contents) {
   min-width: 100px;
   padding-left: 10px;
   padding-right: 10px;
 }
 
 #customization-container {
-  background-color: rgb(247,247,247);
-  color: black;
+  background-color: -moz-field;
+  color: -moz-fieldText;
   text-shadow: none;
 }
 
 #customization-palette,
 #customization-empty {
   padding: 5px 25px 25px;
 }
 
 #customization-header {
   font-size: 1.75em;
   line-height: 1.75em;
-  color: #666;
+  color: GrayText;
   font-weight: 200;
   margin: 25px 25px 12px;
   padding-bottom: 12px;
-  border-bottom: 1px solid #e5e5e5;
+  border-bottom: 1px solid ThreeDLightShadow;
 }
 
 #customization-panel-container {
   padding: 15px 25px 25px;
   background-image: linear-gradient(to bottom, #3e86ce, #3878ba);
 }
 
 #main-window:-moz-any([customize-entering],[customize-entered]) #browser-bottombox,
 #customization-footer {
-  background-color: rgb(236,236,236);
+  background-color: -moz-dialog;
 }
 
 #customization-footer {
-  border-top: 1px solid rgb(221,221,221);
+  border-top: 1px solid ThreeDLightShadow;
   padding: 10px;
 }
 
+%if defined(XP_MACOSX) || defined(XP_WIN)
+%ifdef XP_WIN
+@media (-moz-windows-default-theme) {
+%endif
+
 .customizationmode-button {
   border: 1px solid rgb(192,192,192);
   border-radius: 3px;
   margin: 5px;
   padding: 2px 10px;
   background-color: rgb(251,251,251);
   color: rgb(71,71,71);
   box-shadow: 0 1px rgba(255, 255, 255, 0.5),
@@ -148,29 +153,35 @@
   margin-inline-end: 0;
 }
 
 .customizationmode-button > .button-menu-dropmarker {
   margin-inline-end: 0;
   padding-inline-end: 0;
 }
 
-#customization-titlebar-visibility-button[checked],
-#customization-devedition-theme-button[checked] {
+.customizationmode-button:hover:active:not([disabled]),
+.customizationmode-button[open],
+.customizationmode-button[checked] {
   background-color: rgb(218, 218, 218);
   border-color: rgb(168, 168, 168);
   text-shadow: 0 1px rgb(236, 236, 236);
   box-shadow: 0 1px rgba(255, 255, 255, 0.5),
               inset 0 1px rgb(196, 196, 196);
 }
 
 .customizationmode-button[disabled="true"] {
   opacity: .5;
 }
 
+%ifdef XP_WIN
+} /* @media (-moz-windows-default-theme) */
+%endif
+%endif /* defined(XP_MACOSX) || defined(XP_WIN) */
+
 .customizationmode-button > .box-inherit > .box-inherit > .button-icon,
 .customizationmode-button > .button-box > .button-icon {
   height: 24px;
 }
 
 #customization-titlebar-visibility-button {
   list-style-image: url("chrome://browser/skin/customizableui/customize-titleBar-toggle.png");
   -moz-image-region: rect(0, 24px, 24px, 0);
@@ -289,17 +300,17 @@ toolbarpaletteitem[place="toolbar"]:-moz
   outline-width: 0;
 }
 
 toolbarpaletteitem[place="palette"]:not([mousedown="true"]):-moz-focusring,
 toolbarpaletteitem[place="panel"]:not([mousedown="true"]):-moz-focusring,
 toolbarpaletteitem[place="toolbar"]:not([mousedown="true"]):-moz-focusring {
   /* Delay adding the focusring back until after the transform transition completes. */
   transition: outline-width .01s linear var(--drag-drop-transition-duration);
-  outline: 1px dotted rgba(0,0,0,.5);
+  outline: 1px dotted;
   -moz-outline-radius: 2.5px;
 }
 
 toolbarpaletteitem[place="toolbar"]:not([mousedown="true"]):-moz-focusring {
   outline-offset: -5px;
 }
 
 #wrapper-edit-controls[place="palette"] > #edit-controls > toolbarbutton,
@@ -372,23 +383,23 @@ toolbarpaletteitem[place="toolbar"]:not(
 }
 
 .customization-lwtheme-menu-theme[defaulttheme] {
   list-style-image: url(chrome://browser/skin/theme-switcher-icon.png);
 }
 
 .customization-lwtheme-menu-theme[active="true"],
 .customization-lwtheme-menu-theme:hover {
-  background-color: hsla(210,4%,10%,.08);
-  border-color: hsla(210,4%,10%,.11);
+  background-color: var(--arrowpanel-dimmed);
+  border-color: var(--panel-separator-color);
 }
 
 .customization-lwtheme-menu-theme[active="true"],
 .customization-lwtheme-menu-theme:hover:active {
-  background-color: hsla(210,4%,10%,.15);
+  background-color: var(--arrowpanel-dimmed-further);
 }
 
 .customization-lwtheme-menu-theme > .toolbarbutton-icon {
   margin: 5px;
 }
 
 .customization-lwtheme-menu-theme > .toolbarbutton-text {
   text-align: start;
@@ -398,49 +409,48 @@ toolbarpaletteitem[place="toolbar"]:not(
 #customization-lwtheme-menu-recommended {
   padding: 10px;
   margin-bottom: 5px;
 }
 
 #customization-lwtheme-menu-header,
 #customization-lwtheme-menu-recommended,
 #customization-lwtheme-menu-footer {
-  background-color: hsla(210,4%,10%,.05);
-  color: hsl(0,0%,50%);
+  background-color: var(--arrowpanel-dimmed);
   margin-right: -10px;
   margin-left: -10px;
 }
 
 #customization-lwtheme-menu-header {
   margin-top: -10px;
-  border-bottom: 1px solid hsla(210,4%,10%,.05);
+  border-bottom: 1px solid var(--arrowpanel-dimmed);
 }
 
 #customization-lwtheme-menu-recommended {
-  border-top: 1px solid hsla(210,4%,10%,.05);
-  border-bottom: 1px solid hsla(210,4%,10%,.05);
+  border-top: 1px solid var(--arrowpanel-dimmed);
+  border-bottom: 1px solid var(--arrowpanel-dimmed);
 }
 
 #customization-lwtheme-menu-footer {
-  background: linear-gradient(hsla(210,4%,10%,.05) 60%, transparent) border-box;
-  border-top: 1px solid hsla(210,4%,10%,.05);
+  background: linear-gradient(var(--arrowpanel-dimmed) 60%, transparent) border-box;
+  border-top: 1px solid var(--arrowpanel-dimmed);
   margin-bottom: -10px;
 }
 
 .customization-lwtheme-menu-footeritem {
   -moz-appearance: none;
   -moz-box-flex: 1;
-  color: hsl(0,0%,50%);
+  color: inherit;
   border-style: none;
   padding: 10px;
   margin-left: 0;
   margin-right: 0;
 }
 
 .customization-lwtheme-menu-footeritem:hover {
-  background: linear-gradient(hsla(210,4%,10%,.08) 40%, transparent) padding-box;
+  background: linear-gradient(var(--arrowpanel-dimmed) 40%, transparent) padding-box;
 }
 
 .customization-lwtheme-menu-footeritem:first-child {
-  border-inline-end: 1px solid hsla(210,4%,10%,.15);
+  border-inline-end: 1px solid var(--panel-separator-color);
 }
 
 %include customizeTip.inc.css
--- a/browser/themes/shared/jar.inc.mn
+++ b/browser/themes/shared/jar.inc.mn
@@ -110,16 +110,17 @@
   skin/classic/browser/tabbrowser/connecting@2x.png            (../shared/tabbrowser/connecting@2x.png)
   skin/classic/browser/tabbrowser/crashed.svg                  (../shared/tabbrowser/crashed.svg)
   skin/classic/browser/tabbrowser/pendingpaint.png             (../shared/tabbrowser/pendingpaint.png)
   skin/classic/browser/tabbrowser/tab-audio.svg                (../shared/tabbrowser/tab-audio.svg)
   skin/classic/browser/tabbrowser/tab-audio-small.svg          (../shared/tabbrowser/tab-audio-small.svg)
   skin/classic/browser/tabbrowser/tab-overflow-indicator.png   (../shared/tabbrowser/tab-overflow-indicator.png)
   skin/classic/browser/theme-switcher-icon.png                 (../shared/theme-switcher-icon.png)
   skin/classic/browser/theme-switcher-icon@2x.png              (../shared/theme-switcher-icon@2x.png)
+  skin/classic/browser/toolbarbutton-dropdown-arrow.png        (../shared/toolbarbutton-dropdown-arrow.png)
   skin/classic/browser/translating-16.png                      (../shared/translation/translating-16.png)
   skin/classic/browser/translating-16@2x.png                   (../shared/translation/translating-16@2x.png)
   skin/classic/browser/translation-16.png                      (../shared/translation/translation-16.png)
   skin/classic/browser/translation-16@2x.png                   (../shared/translation/translation-16@2x.png)
   skin/classic/browser/undoCloseTab.png                        (../shared/undoCloseTab.png)
   skin/classic/browser/undoCloseTab@2x.png                     (../shared/undoCloseTab@2x.png)
   skin/classic/browser/update-badge.svg                        (../shared/update-badge.svg)
   skin/classic/browser/update-badge-failed.svg                 (../shared/update-badge-failed.svg)
--- a/browser/themes/shared/plugin-doorhanger.inc.css
+++ b/browser/themes/shared/plugin-doorhanger.inc.css
@@ -47,17 +47,17 @@
 .click-to-play-plugins-notification-link,
 .center-item-link {
   margin: 0;
 }
 
 .messageImage[value="plugin-hidden"] {
   list-style-image: url(chrome://browser/skin/notification-icons.svg#plugin);
   filter: url(chrome://browser/skin/filters.svg#fill);
-  fill: currentColor;
+  fill: #808080;
 }
 
 /* Keep any changes to this style in sync with pluginProblem.css */
 notification.pluginVulnerable {
   background-color: rgb(72,72,72);
   background-image: url(chrome://mozapps/skin/plugins/contentPluginStripe.png);
   color: white;
 }
rename from browser/themes/windows/toolbarbutton-dropdown-arrow.png
rename to browser/themes/shared/toolbarbutton-dropdown-arrow.png
--- a/browser/themes/windows/jar.mn
+++ b/browser/themes/windows/jar.mn
@@ -54,17 +54,16 @@ browser.jar:
   skin/classic/browser/Toolbar-aero.png
   skin/classic/browser/Toolbar-aero@2x.png
   skin/classic/browser/Toolbar-inverted.png
   skin/classic/browser/Toolbar-inverted@2x.png
   skin/classic/browser/Toolbar-lunaSilver.png
   skin/classic/browser/Toolbar-win8.png
   skin/classic/browser/Toolbar-win8@2x.png
   skin/classic/browser/Toolbar-XP.png
-  skin/classic/browser/toolbarbutton-dropdown-arrow.png
   skin/classic/browser/toolbarbutton-dropdown-arrow-XPVista7.png
   skin/classic/browser/toolbarbutton-dropdown-arrow-inverted.png
   skin/classic/browser/urlbar-popup-blocked.png
   skin/classic/browser/urlbar-history-dropmarker.png
   skin/classic/browser/urlbar-history-dropmarker@2x.png
   skin/classic/browser/urlbar-history-dropmarker-XPVista7.png
   skin/classic/browser/urlbar-history-dropmarker-XPVista7@2x.png
   skin/classic/browser/webRTC-indicator.css
--- a/build/autoconf/arch.m4
+++ b/build/autoconf/arch.m4
@@ -197,16 +197,17 @@ if test -n "$all_flags"; then
     if test -n "$thumb_flag"; then
         LDFLAGS="$LDFLAGS $thumb_flag"
     fi
 fi
 
 AC_SUBST(MOZ_THUMB2)
 
 if test "$CPU_ARCH" = "arm"; then
+  NEON_FLAGS="-mfpu=neon"
   AC_MSG_CHECKING(for ARM SIMD support in compiler)
   # We try to link so that this also fails when
   # building with LTO.
   AC_TRY_LINK([],
                  [asm("uqadd8 r1, r1, r2");],
                  result="yes", result="no")
   AC_MSG_RESULT("$result")
   if test "$result" = "yes"; then
@@ -243,10 +244,11 @@ if test "$CPU_ARCH" = "arm"; then
   fi
 
 fi # CPU_ARCH = arm
 
 AC_SUBST(HAVE_ARM_SIMD)
 AC_SUBST(HAVE_ARM_NEON)
 AC_SUBST(BUILD_ARM_NEON)
 AC_SUBST(ARM_ARCH)
+AC_SUBST_LIST(NEON_FLAGS)
 
 ])
--- a/devtools/client/debugger/new/bundle.js
+++ b/devtools/client/debugger/new/bundle.js
@@ -1,9 +1,9 @@
-// Generated from: 02b44328ac19e43705f51209237b20fb264f93f4 Merge pull request #711 from devtools-html/cleanup
+// Generated from: 30002d3cfc4341840af847af9eb2c31cab18abb5 Move some of editor-select.js test into editor-highlight.js to make tests more focused (and avoid timeouts on linux debug) (#746)
 
 var Debugger =
 /******/ (function(modules) { // webpackBootstrap
 /******/ 	// The module cache
 /******/ 	var installedModules = {};
 /******/
 /******/ 	// The require function
 /******/ 	function __webpack_require__(moduleId) {
@@ -21277,18 +21277,18 @@ var Debugger =
 	 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 	
 	var fromJS = __webpack_require__(191);
 	var I = __webpack_require__(192);
 	var makeRecord = __webpack_require__(193);
 	
 	var State = makeRecord({
 	  sources: I.Map(),
-	  selectedSource: undefined,
-	  pendingSelectedSourceURL: undefined,
+	  selectedLocation: undefined,
+	  pendingSelectedLocation: undefined,
 	  sourcesText: I.Map(),
 	  sourceMaps: I.Map(),
 	  tabs: I.List([])
 	});
 	
 	function update() {
 	  var state = arguments.length <= 0 || arguments[0] === undefined ? State() : arguments[0];
 	  var action = arguments[1];
@@ -21307,29 +21307,32 @@ var Debugger =
 	
 	    case "LOAD_SOURCE_MAP":
 	      if (action.status == "done") {
 	        return state.mergeIn(["sourceMaps", action.source.id], action.value.sourceMap);
 	      }
 	      break;
 	
 	    case "SELECT_SOURCE":
-	      return state.merge({
-	        selectedSource: action.source,
-	        pendingSelectedSourceURL: null,
-	        tabs: updateTabList(state, fromJS(action.source), action.options)
+	      return state.set("selectedLocation", {
+	        sourceId: action.source.id,
+	        line: action.line
+	      }).set("pendingSelectedLocation", null).merge({
+	        tabs: updateTabList(state, fromJS(action.source), action.tabIndex)
 	      });
 	
 	    case "SELECT_SOURCE_URL":
-	      return state.merge({ pendingSelectedSourceURL: action.url });
+	      return state.set("pendingSelectedLocation", {
+	        url: action.url,
+	        line: action.line
+	      });
 	
 	    case "CLOSE_TAB":
-	      return state.merge({
-	        selectedSource: getNewSelectedSource(state, action.id),
-	        tabs: removeSourceFromTabList(state, action.id)
+	      return state.merge({ tabs: removeSourceFromTabList(state, action.id) }).set("selectedLocation", {
+	        sourceId: getNewSelectedSourceId(state, action.id)
 	      });
 	
 	    case "LOAD_SOURCE_TEXT":
 	      {
 	        var values = void 0;
 	        if (action.status === "done") {
 	          var _action$value = action.value;
 	          var generatedSourceText = _action$value.generatedSourceText;
@@ -21354,19 +21357,19 @@ var Debugger =
 	    case "TOGGLE_PRETTY_PRINT":
 	      if (action.status === "done") {
 	        return _updateText(state, action, [action.value.sourceText]).setIn(["sources", action.source.id, "isPrettyPrinted"], action.value.isPrettyPrinted);
 	      }
 	
 	      return _updateText(state, action, [action.originalSource]);
 	
 	    case "NAVIGATE":
-	      var source = state.selectedSource;
-	      var sourceUrl = source && source.get("url");
-	      return State().set("pendingSelectedSourceURL", sourceUrl);
+	      var source = getSelectedSource({ sources: state });
+	      var _url = source && source.get("url");
+	      return State().set("pendingSelectedLocation", { url: _url });
 	  }
 	
 	  return state;
 	}
 	
 	function _updateText(state, action, values) {
 	  if (action.status === "start") {
 	    // Merge this in, don't set it. That way the previous value is
@@ -21397,60 +21400,60 @@ var Debugger =
 	
 	function removeSourceFromTabList(state, id) {
 	  return state.tabs.filter(tab => tab.get("id") != id);
 	}
 	
 	/*
 	 * Adds the new source to the tab list if it is not already there
 	 */
-	function updateTabList(state, source, options) {
+	function updateTabList(state, source, tabIndex) {
 	  var tabs = state.get("tabs");
-	  var selectedSource = state.get("selectedSource");
+	  var selectedSource = getSelectedSource({ sources: state });
 	  var selectedSourceIndex = tabs.indexOf(selectedSource);
 	  var sourceIndex = tabs.indexOf(source);
 	  var includesSource = !!tabs.find(t => t.get("id") == source.get("id"));
 	
 	  if (includesSource) {
-	    if (options.position != undefined) {
-	      return tabs.delete(sourceIndex).insert(options.position, source);
+	    if (tabIndex != undefined) {
+	      return tabs.delete(sourceIndex).insert(tabIndex, source);
 	    }
 	
 	    return tabs;
 	  }
 	
 	  return tabs.insert(selectedSourceIndex + 1, source);
 	}
 	
 	/**
 	 * Gets the next tab to select when a tab closes.
 	 */
-	function getNewSelectedSource(state, id) {
+	function getNewSelectedSourceId(state, id) {
 	  var tabs = state.get("tabs");
-	  var selectedSource = state.get("selectedSource");
+	  var selectedSource = getSelectedSource({ sources: state });
 	
 	  // if we're not closing the selected tab return the selected tab
 	  if (selectedSource.get("id") != id) {
-	    return selectedSource;
+	    return selectedSource.get("id");
 	  }
 	
 	  var tabIndex = tabs.findIndex(tab => tab.get("id") == id);
 	  var numTabs = tabs.count();
 	
 	  if (numTabs == 1) {
 	    return undefined;
 	  }
 	
 	  // if we're closing the last tab, select the penultimate tab
 	  if (tabIndex + 1 == numTabs) {
-	    return tabs.get(tabIndex - 1);
+	    return tabs.get(tabIndex - 1).get("id");
 	  }
 	
 	  // return the next tab
-	  return tabs.get(tabIndex + 1);
+	  return tabs.get(tabIndex + 1).get("id");
 	}
 	
 	// Selectors
 	
 	// Unfortunately, it's really hard to make these functions accept just
 	// the state that we care about and still type if with Flow. The
 	// problem is that we want to re-export all selectors from a single
 	// module for the UI, and all of those selectors should take the
@@ -21479,21 +21482,25 @@ var Debugger =
 	  return state.sources.sourcesText.get(id);
 	}
 	
 	function getSourceTabs(state) {
 	  return state.sources.tabs;
 	}
 	
 	function getSelectedSource(state) {
-	  return state.sources.selectedSource;
-	}
-	
-	function getPendingSelectedSourceURL(state) {
-	  return state.sources.pendingSelectedSourceURL;
+	  return state.sources.selectedLocation && getSource(state, state.sources.selectedLocation.sourceId);
+	}
+	
+	function getSelectedLocation(state) {
+	  return state.sources.selectedLocation;
+	}
+	
+	function getPendingSelectedLocation(state) {
+	  return state.sources.pendingSelectedLocation;
 	}
 	
 	function getSourceMap(state, sourceId) {
 	  return state.sources.sourceMaps.get(sourceId);
 	}
 	
 	function getPrettySource(state, id) {
 	  var source = getSource(state, id);
@@ -21509,17 +21516,18 @@ var Debugger =
 	  update,
 	  getSource,
 	  getSourceByURL,
 	  getSourceById,
 	  getSources,
 	  getSourceText,
 	  getSourceTabs,
 	  getSelectedSource,
-	  getPendingSelectedSourceURL,
+	  getSelectedLocation,
+	  getPendingSelectedLocation,
 	  getSourceMap,
 	  getPrettySource
 	};
 
 /***/ },
 /* 191 */
 /***/ function(module, exports, __webpack_require__) {
 
@@ -26879,33 +26887,31 @@ var Debugger =
 	
 	function update() {
 	  var state = arguments.length <= 0 || arguments[0] === undefined ? initialState : arguments[0];
 	  var action = arguments[1];
 	  var emit = arguments[2];
 	
 	  switch (action.type) {
 	    case constants.PAUSED:
-	      if (action.status == "done") {
-	        var _action$value = action.value;
-	        var selectedFrameId = _action$value.selectedFrameId;
-	        var frames = _action$value.frames;
-	        var pauseInfo = _action$value.pauseInfo;
+	      {
+	        var selectedFrameId = action.selectedFrameId;
+	        var frames = action.frames;
+	        var pauseInfo = action.pauseInfo;
 	
 	        pauseInfo.isInterrupted = pauseInfo.why.type === "interrupted";
 	
 	        return state.merge({
 	          isWaitingOnBreak: false,
 	          pause: fromJS(pauseInfo),
 	          selectedFrameId,
 	          frames
 	        });
 	      }
 	
-	      break;
 	    case constants.RESUME:
 	      return state.merge({
 	        pause: null,
 	        frames: null,
 	        selectedFrameId: null,
 	        loadedObjects: {}
 	      });
 	
@@ -27066,17 +27072,18 @@ var Debugger =
 	module.exports = {
 	  getSource: sources.getSource,
 	  getSourceByURL: sources.getSourceByURL,
 	  getSourceById: sources.getSourceById,
 	  getSources: sources.getSources,
 	  getSourceText: sources.getSourceText,
 	  getSourceTabs: sources.getSourceTabs,
 	  getSelectedSource: sources.getSelectedSource,
-	  getPendingSelectedSourceURL: sources.getPendingSelectedSourceURL,
+	  getSelectedLocation: sources.getSelectedLocation,
+	  getPendingSelectedLocation: sources.getPendingSelectedLocation,
 	  getSourceMap: sources.getSourceMap,
 	  getPrettySource: sources.getPrettySource,
 	
 	  getSourceMapURL,
 	
 	  getBreakpoint: breakpoints.getBreakpoint,
 	  getBreakpoints: breakpoints.getBreakpoints,
 	  getBreakpointsForSource: breakpoints.getBreakpointsForSource,
@@ -28761,17 +28768,17 @@ var Debugger =
 	  },
 	
 	  toggleSourcesSearch(key, e) {
 	    e.preventDefault();
 	    this.setState({ searchOn: !this.state.searchOn });
 	  },
 	
 	  onKeyDown(e) {
-	    if (e.key === "Escape") {
+	    if (this.state.searchOn && e.key === "Escape") {
 	      this.setState({ searchOn: false });
 	      e.preventDefault();
 	    }
 	  },
 	
 	  closeSourcesSearch() {
 	    this.setState({ searchOn: false });
 	  },
@@ -30161,17 +30168,17 @@ var Debugger =
 	var makeOriginalSource = _require8.makeOriginalSource;
 	var getGeneratedSource = _require8.getGeneratedSource;
 	
 	var _require9 = __webpack_require__(198);
 	
 	var getSource = _require9.getSource;
 	var getSourceByURL = _require9.getSourceByURL;
 	var getSourceText = _require9.getSourceText;
-	var getPendingSelectedSourceURL = _require9.getPendingSelectedSourceURL;
+	var getPendingSelectedLocation = _require9.getPendingSelectedLocation;
 	var getSourceMap = _require9.getSourceMap;
 	var getSourceMapURL = _require9.getSourceMapURL;
 	var getFrames = _require9.getFrames;
 	
 	
 	function _shouldSourceMap(generatedSource) {
 	  return isEnabled("sourceMaps") && generatedSource.sourceMapURL;
 	}
@@ -30191,19 +30198,19 @@ var Debugger =
 	    if (_shouldSourceMap(source)) {
 	      dispatch(loadSourceMap(source));
 	    }
 	
 	    dispatch(_addSource(source));
 	
 	    // If a request has been made to show this source, go ahead and
 	    // select it.
-	    var pendingURL = getPendingSelectedSourceURL(getState());
-	    if (pendingURL === source.url) {
-	      dispatch(selectSource(source.id));
+	    var pendingLocation = getPendingSelectedLocation(getState());
+	    if (pendingLocation && pendingLocation.url === source.url) {
+	      dispatch(selectSource(source.id, { line: pendingLocation.line }));
 	    }
 	  };
 	}
 	
 	/**
 	 * @memberof actions/sources
 	 * @static
 	 */
@@ -30241,27 +30248,31 @@ var Debugger =
 	 * work regardless of the connection status or if the source exists
 	 * yet. This exists mostly for external things to interact with the
 	 * debugger.
 	 *
 	 * @memberof actions/sources
 	 * @static
 	 */
 	function selectSourceURL(url) {
+	  var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
+	
 	  return _ref7 => {
 	    var dispatch = _ref7.dispatch;
 	    var getState = _ref7.getState;
 	
 	    var source = getSourceByURL(getState(), url);
 	    if (source) {
-	      dispatch(selectSource(source.get("id")));
+	      dispatch(selectSource(source.get("id"), options));
 	    } else {
 	      dispatch({
 	        type: constants.SELECT_SOURCE_URL,
-	        url: url
+	        url: url,
+	        tabIndex: options.tabIndex,
+	        line: options.line
 	      });
 	    }
 	  };
 	}
 	
 	/**
 	 * @memberof actions/sources
 	 * @static
@@ -30283,17 +30294,18 @@ var Debugger =
 	    var source = getSource(getState(), id).toJS();
 	
 	    // Make sure to start a request to load the source text.
 	    dispatch(loadSourceText(source));
 	
 	    dispatch({
 	      type: constants.SELECT_SOURCE,
 	      source: source,
-	      options
+	      tabIndex: options.tabIndex,
+	      line: options.line
 	    });
 	  };
 	}
 	
 	/**
 	 * @memberof actions/sources
 	 * @static
 	 */
@@ -30762,41 +30774,41 @@ var Debugger =
 	/**
 	 * Debugger has just paused
 	 *
 	 * @param {object} pauseInfo
 	 * @memberof actions/pause
 	 * @static
 	 */
 	function paused(pauseInfo) {
-	  return _ref2 => {
-	    var dispatch = _ref2.dispatch;
-	    var getState = _ref2.getState;
-	    var client = _ref2.client;
-	    var frame = pauseInfo.frame;
-	    var frames = pauseInfo.frames;
-	    var why = pauseInfo.why;
-	
-	
-	    dispatch(evaluateExpressions());
-	
-	    return dispatch({
-	      type: constants.PAUSED,
-	      [PROMISE]: _asyncToGenerator(function* () {
-	        frames = yield updateFrameLocations(getState(), frames);
-	
-	        dispatch(selectSource(frame.location.sourceId));
-	        return {
-	          pauseInfo: { why, frame },
-	          frames: frames,
-	          selectedFrameId: frame.id
-	        };
-	      })()
-	    });
-	  };
+	  return (() => {
+	    var _ref2 = _asyncToGenerator(function* (_ref3) {
+	      var dispatch = _ref3.dispatch;
+	      var getState = _ref3.getState;
+	      var client = _ref3.client;
+	      var frame = pauseInfo.frame;
+	      var frames = pauseInfo.frames;
+	      var why = pauseInfo.why;
+	
+	      frames = yield updateFrameLocations(getState(), frames);
+	
+	      dispatch(evaluateExpressions());
+	      dispatch({
+	        type: constants.PAUSED,
+	        pauseInfo: { why, frame },
+	        frames: frames,
+	        selectedFrameId: frame.id
+	      });
+	      dispatch(selectSource(frame.location.sourceId, { line: frame.location.line }));
+	    });
+	
+	    return function (_x) {
+	      return _ref2.apply(this, arguments);
+	    };
+	  })();
 	}
 	
 	/**
 	 *
 	 * @memberof actions/pause
 	 * @static
 	 */
 	function pauseOnExceptions(shouldPauseOnExceptions, shouldIgnoreCaughtExceptions) {
@@ -32778,33 +32790,33 @@ var Debugger =
 	var _require3 = __webpack_require__(45);
 	
 	var debugGlobal = _require3.debugGlobal;
 	
 	var _require4 = __webpack_require__(198);
 	
 	var getSourceText = _require4.getSourceText;
 	var getBreakpointsForSource = _require4.getBreakpointsForSource;
-	var getSelectedSource = _require4.getSelectedSource;
+	var getSelectedLocation = _require4.getSelectedLocation;
 	var getSelectedFrame = _require4.getSelectedFrame;
 	
 	var _require5 = __webpack_require__(194);
 	
 	var makeLocationId = _require5.makeLocationId;
 	
 	var actions = __webpack_require__(213);
 	var Breakpoint = React.createFactory(__webpack_require__(263));
 	var dom = React.DOM;
 	var PropTypes = React.PropTypes;
 	
 	
 	__webpack_require__(264);
 	
-	function isSourceForFrame(source, frame) {
-	  return source && frame && frame.location.sourceId === source.get("id");
+	function isTextForSource(sourceText) {
+	  return !sourceText.get("loading") && !sourceText.get("error");
 	}
 	
 	/**
 	 * Forces the breakpoint gutter to be the same size as the line
 	 * numbers gutter. Editor CSS will absolutely position the gutter
 	 * beneath the line numbers. This makes it easy to be flexible with
 	 * how we overlay breakpoints.
 	 */
@@ -32813,17 +32825,17 @@ var Debugger =
 	  var lineNumbers = gutters.querySelector(".CodeMirror-linenumbers");
 	  var breakpoints = gutters.querySelector(".breakpoints");
 	  breakpoints.style.width = lineNumbers.clientWidth + "px";
 	}
 	
 	var Editor = React.createClass({
 	  propTypes: {
 	    breakpoints: ImPropTypes.map.isRequired,
-	    selectedSource: ImPropTypes.map,
+	    selectedLocation: PropTypes.object,
 	    sourceText: PropTypes.object,
 	    addBreakpoint: PropTypes.func,
 	    removeBreakpoint: PropTypes.func,
 	    selectedFrame: PropTypes.object
 	  },
 	
 	  displayName: "Editor",
 	
@@ -32833,68 +32845,75 @@ var Debugger =
 	    });
 	
 	    if (bp && bp.loading) {
 	      return;
 	    }
 	
 	    if (bp) {
 	      this.props.removeBreakpoint({
-	        sourceId: this.props.selectedSource.get("id"),
+	        sourceId: this.props.selectedLocation.sourceId,
 	        line: line + 1
 	      });
 	    } else {
-	      this.props.addBreakpoint({ sourceId: this.props.selectedSource.get("id"),
+	      this.props.addBreakpoint({ sourceId: this.props.selectedLocation.sourceId,
 	        line: line + 1 },
 	      // Pass in a function to get line text because the breakpoint
 	      // may slide and it needs to compute the value at the new
 	      // line.
 	      { getTextForLine: l => cm.getLine(l - 1).trim() });
 	    }
 	  },
 	
-	  clearDebugLine(line) {
-	    this.editor.codeMirror.removeLineClass(line - 1, "line", "debug-line");
-	  },
-	
-	  setDebugLine(line) {
-	    this.editor.codeMirror.addLineClass(line - 1, "line", "debug-line");
+	  updateDebugLine(prevProps, nextProps) {
+	    if (prevProps.selectedFrame) {
+	      var line = prevProps.selectedFrame.location.line;
+	      this.editor.codeMirror.removeLineClass(line - 1, "line", "debug-line");
+	    }
+	    if (nextProps.selectedFrame) {
+	      var _line = nextProps.selectedFrame.location.line;
+	      this.editor.codeMirror.addLineClass(_line - 1, "line", "debug-line");
+	    }
+	  },
+	
+	  highlightLine() {
+	    if (!this.pendingJumpLine) {
+	      return;
+	    }
+	
+	    // If the location has changed and a specific line is requested,
+	    // move to that line and flash it.
+	    var codeMirror = this.editor.codeMirror;
+	
+	    // Make sure to clean up after ourselves. Not only does this
+	    // cancel any existing animation, but it avoids it from
+	    // happening ever again (in case CodeMirror re-applies the
+	    // class, etc).
+	    if (this.lastJumpLine) {
+	      codeMirror.removeLineClass(this.lastJumpLine - 1, "line", "highlight-line");
+	    }
+	
+	    var line = this.pendingJumpLine;
 	    this.editor.alignLine(line);
-	  },
-	
-	  setSourceText(newSourceText, oldSourceText) {
-	    if (newSourceText.get("loading")) {
-	      this.setText("Loading...");
-	      return;
-	    }
-	
-	    if (newSourceText.get("error")) {
-	      this.setText("Error");
-	      console.error(newSourceText.get("error"));
-	      return;
-	    }
-	
-	    this.setText(newSourceText.get("text"));
-	    this.setMode(newSourceText);
-	
-	    resizeBreakpointGutter(this.editor.codeMirror);
-	  },
-	
-	  // Only reset the editor text if the source has changed.
-	  // * Resetting the text will remove the breakpoints.
-	  // * Comparing the source text is probably inneficient.
+	
+	    // We only want to do the flashing animation if it's not a debug
+	    // line, which has it's own styling.
+	    if (!this.props.selectedFrame || this.props.selectedFrame.location.line !== line) {
+	      this.editor.codeMirror.addLineClass(line - 1, "line", "highlight-line");
+	    }
+	
+	    this.lastJumpLine = line;
+	    this.pendingJumpLine = null;
+	  },
+	
 	  setText(text) {
 	    if (!text || !this.editor) {
 	      return;
 	    }
 	
-	    if (text == this.editor.getText()) {
-	      return;
-	    }
-	
 	    this.editor.setText(text);
 	  },
 	
 	  setMode(sourceText) {
 	    var contentType = sourceText.get("contentType");
 	
 	    if (contentType.includes("javascript")) {
 	      this.editor.setMode({ name: "javascript" });
@@ -32935,34 +32954,62 @@ var Debugger =
 	  },
 	
 	  componentWillUnmount() {
 	    this.editor.destroy();
 	    this.editor = null;
 	  },
 	
 	  componentWillReceiveProps(nextProps) {
-	    // Clear the currently highlighted line
-	    if (isSourceForFrame(this.props.selectedSource, this.props.selectedFrame)) {
-	      this.clearDebugLine(this.props.selectedFrame.location.line);
-	    }
-	
-	    // Set the source text. The source text may not have been loaded
-	    // yet. On startup, the source text may not exist yet.
-	    if (nextProps.sourceText) {
-	      this.setSourceText(nextProps.sourceText, this.props.sourceText);
-	    }
-	
-	    if (this.props.selectedSource && !nextProps.selectedSource) {
-	      this.editor.setText("");
-	    }
-	
-	    // Highlight the paused line if necessary
-	    if (isSourceForFrame(nextProps.selectedSource, nextProps.selectedFrame)) {
-	      this.setDebugLine(nextProps.selectedFrame.location.line);
+	    // This lifecycle method is responsible for updating the editor
+	    // text.
+	    var sourceText = nextProps.sourceText;
+	
+	    if (!sourceText) {
+	      this.setText("");
+	      this.editor.setMode({ name: "text" });
+	    } else if (!isTextForSource(sourceText)) {
+	      // There are only 2 possible states: errored or loading. Do
+	      // nothing except put a message in the editor.
+	      this.setText(sourceText.get("error") || "Loading...");
+	      this.editor.setMode({ name: "text" });
+	    } else if (this.props.sourceText !== sourceText) {
+	      // Only update it if the `sourceText` object has actually changed.
+	      // It is immutable so it will always change when updated.
+	      this.setText(sourceText.get("text"));
+	      this.setMode(sourceText);
+	      resizeBreakpointGutter(this.editor.codeMirror);
+	    }
+	  },
+	
+	  componentDidUpdate(prevProps) {
+	    // This is in `componentDidUpdate` so helper functions can expect
+	    // `this.props` to be the current props. This lifecycle method is
+	    // responsible for updating the editor annotations.
+	    var selectedLocation = this.props.selectedLocation;
+	
+	    // If the location is different and a new line is requested,
+	    // update the pending jump line. Note that if jumping to a line in
+	    // a source where the text hasn't been loaded yet, we will set the
+	    // line here but not jump until rendering the actual source.
+	
+	    if (prevProps.selectedLocation !== selectedLocation) {
+	      if (selectedLocation && selectedLocation.line != undefined) {
+	        this.pendingJumpLine = selectedLocation.line;
+	      } else {
+	        this.pendingJumpLine = null;
+	      }
+	    }
+	
+	    // Only update and jump around in real source texts. This will
+	    // keep the jump state around until the real source text is
+	    // loaded.
+	    if (this.props.sourceText && isTextForSource(this.props.sourceText)) {
+	      this.updateDebugLine(prevProps, this.props);
+	      this.highlightLine();
 	    }
 	  },
 	
 	  render() {
 	    var _props = this.props;
 	    var breakpoints = _props.breakpoints;
 	    var sourceText = _props.sourceText;
 	
@@ -32974,23 +33021,23 @@ var Debugger =
 	        breakpoint: bp,
 	        editor: this.editor && this.editor.codeMirror
 	      });
 	    }));
 	  }
 	});
 	
 	module.exports = connect((state, props) => {
-	  var selectedSource = getSelectedSource(state);
-	  var selectedId = selectedSource && selectedSource.get("id");
+	  var selectedLocation = getSelectedLocation(state);
+	  var sourceId = selectedLocation && selectedLocation.sourceId;
 	
 	  return {
-	    selectedSource,
-	    sourceText: getSourceText(state, selectedId),
-	    breakpoints: getBreakpointsForSource(state, selectedId),
+	    selectedLocation,
+	    sourceText: getSourceText(state, sourceId),
+	    breakpoints: getBreakpointsForSource(state, sourceId),
 	    selectedFrame: getSelectedFrame(state)
 	  };
 	}, dispatch => bindActionCreators(actions, dispatch))(Editor);
 
 /***/ },
 /* 262 */
 /***/ function(module, exports) {
 
@@ -33226,16 +33273,23 @@ var Debugger =
 	
 	var _require4 = __webpack_require__(46);
 	
 	var isEnabled = _require4.isEnabled;
 	
 	var Svg = __webpack_require__(234);
 	var ImPropTypes = __webpack_require__(227);
 	
+	var _require5 = __webpack_require__(212);
+	
+	var Services = _require5.Services;
+	
+	var shiftKey = Services.appinfo.OS === "Darwin" ? "\u21E7" : "Shift+";
+	var ctrlKey = Services.appinfo.OS === "Linux" ? "Ctrl+" : "";
+	
 	var actions = __webpack_require__(213);
 	var Breakpoints = React.createFactory(__webpack_require__(271));
 	var Expressions = React.createFactory(__webpack_require__(274));
 	var Scopes = React.createFactory(__webpack_require__(307));
 	var Frames = React.createFactory(__webpack_require__(339));
 	var Accordion = React.createFactory(__webpack_require__(342));
 	__webpack_require__(345);
 	
@@ -33301,36 +33355,36 @@ var Debugger =
 	
 	    if (this.keyShortcutsEnabled) {
 	      return;
 	    }
 	
 	    this.keyShortcutsEnabled = true;
 	    keyShortcuts.on("F8", this.resume);
 	    keyShortcuts.on("F10", this.stepOver);
-	    keyShortcuts.on("F11", this.stepIn);
-	    keyShortcuts.on("F12", this.stepOut);
+	    keyShortcuts.on(`${ ctrlKey }F11`, this.stepIn);
+	    keyShortcuts.on(`${ ctrlKey }Shift+F11`, this.stepOut);
 	  },
 	
 	  componentWillUnmount() {
 	    var keyShortcuts = this.props.keyShortcuts;
 	
 	    keyShortcuts.off("F8", this.resume);
 	    keyShortcuts.off("F10", this.stepOver);
-	    keyShortcuts.off("F11", this.stepIn);
-	    keyShortcuts.off("F12", this.stepOut);
+	    keyShortcuts.off(`${ ctrlKey }F11`, this.stepIn);
+	    keyShortcuts.off(`${ ctrlKey }Shift+F11`, this.stepOut);
 	  },
 	
 	  componentDidUpdate() {
 	    this.setupKeyboardShortcuts();
 	  },
 	
 	  renderStepButtons() {
 	    var className = this.props.pause ? "active" : "disabled";
-	    return [debugBtn(this.stepOver, "stepOver", className, "Step Over (F10)"), debugBtn(this.stepIn, "stepIn", className, "Step In (F11)"), debugBtn(this.stepOut, "stepOut", className, "Step Out \u21E7 (F12)")];
+	    return [debugBtn(this.stepOver, "stepOver", className, "Step Over (F10)"), debugBtn(this.stepIn, "stepIn", className, `Step In (${ ctrlKey }F11)`), debugBtn(this.stepOut, "stepOut", className, `Step Out (${ ctrlKey }${ shiftKey }F11)`)];
 	  },
 	
 	  renderPauseButton() {
 	    var _props = this.props;
 	    var pause = _props.pause;
 	    var breakOnNext = _props.breakOnNext;
 	    var isWaitingOnBreak = _props.isWaitingOnBreak;
 	
@@ -37717,17 +37771,17 @@ var Debugger =
 	    var url = source && source.get("url");
 	    var filename = getFilename(url);
 	    var sourceTabEls = this.refs.sourceTabs.children;
 	
 	    return dom.li({
 	      key: source.get("id"),
 	      onClick: () => {
 	        var tabIndex = getLastVisibleTabIndex(sourceTabs, sourceTabEls);
-	        selectSource(source.get("id"), { position: tabIndex });
+	        selectSource(source.get("id"), { tabIndex });
 	        this.toggleSourcesDropdown();
 	      }
 	    }, filename);
 	  },
 	
 	  renderSourcesDropdownButon() {
 	    var hiddenSourceTabs = this.state.hiddenSourceTabs;
 	    if (!hiddenSourceTabs || hiddenSourceTabs.size == 0) {
@@ -37900,17 +37954,17 @@ var Debugger =
 	
 	    return debugBtn(this.onClickPrettyPrint, "prettyPrint", classnames({
 	      active: sourceLoaded,
 	      pretty: isPretty(selectedSource.toJS())
 	    }), "Prettify Source");
 	  },
 	
 	  render() {
-	    if (!this.props.selectedSource) {
+	    if (!this.props.selectedSource || !isEnabled("prettyPrint") && !isEnabled("blackBox")) {
 	      return null;
 	    }
 	
 	    return dom.div({ className: "source-footer" }, dom.div({ className: "command-bar" }, this.blackboxButton(), this.prettyPrintButton()));
 	  }
 	});
 	
 	module.exports = connect(state => {
@@ -37941,28 +37995,30 @@ var Debugger =
 	var _require = __webpack_require__(356);
 	
 	var filter = _require.filter;
 	
 	var classnames = __webpack_require__(206);
 	__webpack_require__(362);
 	var Svg = __webpack_require__(234);
 	
+	var INITIAL_SELECTED_INDEX = 0;
+	
 	var Autocomplete = React.createClass({
 	  propTypes: {
 	    selectItem: PropTypes.func,
 	    items: PropTypes.array
 	  },
 	
 	  displayName: "Autocomplete",
 	
 	  getInitialState() {
 	    return {
 	      inputValue: "",
-	      selectedIndex: -1
+	      selectedIndex: INITIAL_SELECTED_INDEX
 	    };
 	  },
 	
 	  componentDidMount() {
 	    this.refs.searchInput.focus();
 	  },
 	
 	  componentDidUpdate() {
@@ -37995,17 +38051,17 @@ var Debugger =
 	    }, dom.div({ className: "title" }, result.title), dom.div({ className: "subtitle" }, result.subtitle));
 	  },
 	
 	  renderInput() {
 	    return dom.input({
 	      ref: "searchInput",
 	      onChange: e => this.setState({
 	        inputValue: e.target.value,
-	        selectedIndex: -1
+	        selectedIndex: INITIAL_SELECTED_INDEX
 	      }),
 	      onFocus: e => this.setState({ focused: true }),
 	      onBlur: e => this.setState({ focused: false }),
 	      onKeyDown: this.onKeyDown,
 	      placeholder: "Search..."
 	    });
 	  },
 	
--- a/devtools/client/debugger/new/index.html
+++ b/devtools/client/debugger/new/index.html
@@ -1,24 +1,24 @@
 <!-- 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/. -->
 <!DOCTYPE html>
 <html>
   <head>
-    <link rel="stylesheet" type="text/css" href="resource://devtools/client/debugger/new/styles.css" />
     <link rel="stylesheet"
           type="text/css"
           href="chrome://devtools/content/sourceeditor/codemirror/lib/codemirror.css" />
     <link rel="stylesheet"
           type="text/css"
           href="chrome://devtools/content/sourceeditor/codemirror/addon/dialog/dialog.css" />
     <link rel="stylesheet"
           type="text/css"
           href="chrome://devtools/content/sourceeditor/codemirror/mozilla.css" />
+    <link rel="stylesheet" type="text/css" href="resource://devtools/client/debugger/new/styles.css" />
   </head>
   <body>
     <div id="mount"></div>
     <script type="application/javascript;version=1.8"
             src="chrome://devtools/content/shared/theme-switching.js"></script>
     <script type="text/javascript">
       const { BrowserLoader } = Components.utils.import("resource://devtools/client/shared/browser-loader.js", {});
       const { require: devtoolsRequire } = BrowserLoader({
--- a/devtools/client/debugger/new/source-map-worker.js
+++ b/devtools/client/debugger/new/source-map-worker.js
@@ -146,17 +146,17 @@ var Debugger =
 	}
 	
 	function getOriginalSourcePosition(generatedSource, _ref3) {
 	  var column = _ref3.column;
 	  var line = _ref3.line;
 	
 	  var consumer = _getConsumer(generatedSource.id);
 	
-	  // if there is not a consumer, then its a generated source without a map
+	  // if there is not a consumer, then it's a generated source without a map
 	  if (!consumer) {
 	    return {
 	      url: generatedSource.url,
 	      line,
 	      column
 	    };
 	  }
 	
--- a/devtools/client/debugger/new/styles.css
+++ b/devtools/client/debugger/new/styles.css
@@ -376,16 +376,25 @@ ul.sources-list {
 }
 
 /* Don't display the highlight color since the debug line
    is already highlighted */
 .debug-line .CodeMirror-activeline-background {
   display: none;
 }
 
+.highlight-line .CodeMirror-line {
+  animation: fade-highlight-out 1.5s normal forwards;
+}
+
+@keyframes fade-highlight-out {
+  0% { background-color: var(--theme-highlight-gray); }
+  100% { background-color: transparent; }
+}
+
 .welcomebox {
   width: 100%;
 
   /* Offsetting it by 30px for the sources-header area */
   height: calc(100% - 30px);
   position: absolute;
   top: 30px;
   left: 0;
--- a/devtools/client/debugger/new/test/mochitest/.eslintrc
+++ b/devtools/client/debugger/new/test/mochitest/.eslintrc
@@ -38,27 +38,34 @@
     "promise": false,
     "BrowserToolboxProcess": false,
     "OS": false,
     "waitForNextDispatch": false,
     "waitForDispatch": false,
     "waitForThreadEvents": false,
     "waitForState": false,
     "waitForPaused": false,
+    "waitForSources": false,
     "isPaused": false,
     "assertPausedLocation": false,
+    "assertHighlightLocation": false,
     "initDebugger": false,
     "invokeInTab": false,
     "findSource": false,
     "findElement": false,
+    "findAllElements": false,
     "selectSource": false,
     "stepOver": false,
     "stepIn": false,
     "stepOut": false,
     "resume": false,
     "reload": false,
+    "navigate": false,
+    "removeBreakpoint": false,
     "addBreakpoint": false,
     "toggleCallStack": false,
     "isVisibleWithin": false,
     "clickElement": false,
-    "togglePauseOnExceptions": false
+    "togglePauseOnExceptions": false,
+    "pressKey": false,
+    "EXAMPLE_URL": false
   }
 }
--- a/devtools/client/debugger/new/test/mochitest/browser.ini
+++ b/devtools/client/debugger/new/test/mochitest/browser.ini
@@ -1,28 +1,32 @@
 [DEFAULT]
 tags = devtools
 subsuite = devtools
 support-files =
   head.js
   !/devtools/client/commandline/test/helpers.js
   !/devtools/client/framework/test/shared-head.js
   examples/doc-scripts.html
-  examples/doc-script-switching-01.html
+  examples/doc-script-switching.html
   examples/doc-exceptions.html
   examples/doc-iframes.html
   examples/doc-debugger-statements.html
   examples/code-exceptions.js
   examples/code-simple1.js
   examples/code-simple2.js
   examples/code-long.js
   examples/code-script-switching-02.js
   examples/code-script-switching-01.js
 
 [browser_dbg-editor-gutter.js]
 [browser_dbg-editor-mode.js]
 [browser_dbg-editor-select.js]
+[browser_dbg-editor-highlight.js]
 [browser_dbg-call-stack.js]
 [browser_dbg-pause-exceptions.js]
 [browser_dbg-chrome-create.js]
 [browser_dbg-chrome-debugging.js]
 [browser_dbg-iframes.js]
 [browser_dbg-debugger-buttons.js]
+[browser_dbg_keyboard-shortcuts.js]
+[browser_dbg-navigation.js]
+[browser_dbg-console.js]
--- a/devtools/client/debugger/new/test/mochitest/browser_dbg-call-stack.js
+++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-call-stack.js
@@ -12,17 +12,17 @@ function isFrameSelected(dbg, index, tit
   const elSelected = $frame.classList.contains("selected");
   const titleSelected = frame.displayName == title;
 
   return elSelected && titleSelected;
 }
 
 add_task(function* () {
   const dbg = yield initDebugger(
-    "doc-script-switching-01.html",
+    "doc-script-switching.html",
     "script-switching-01.js"
   );
 
   toggleCallStack(dbg);
 
   invokeInTab("firstCall");
   yield waitForPaused(dbg);
 
new file mode 100644
--- /dev/null
+++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-console.js
@@ -0,0 +1,34 @@
+// Return a promise with a reference to jsterm, opening the split
+// console if necessary.  This cleans up the split console pref so
+// it won't pollute other tests.
+function getSplitConsole(dbg) {
+  const { toolbox, win } = dbg;
+
+  registerCleanupFunction(() => {
+    Services.prefs.clearUserPref("devtools.toolbox.splitconsoleEnabled");
+  });
+
+  if (!win) {
+    win = toolbox.win;
+  }
+
+  if (!toolbox.splitConsole) {
+    EventUtils.synthesizeKey("VK_ESCAPE", {}, win);
+  }
+
+  return new Promise(resolve => {
+    toolbox.getPanelWhenReady("webconsole").then(() => {
+      ok(toolbox.splitConsole, "Split console is shown.");
+      let jsterm = toolbox.getPanel("webconsole").hud.jsterm;
+      resolve(jsterm);
+    });
+  });
+}
+
+add_task(function* () {
+  Services.prefs.setBoolPref("devtools.toolbox.splitconsoleEnabled", true);
+  const dbg = yield initDebugger("doc-script-switching.html");
+
+  yield getSplitConsole(dbg);
+  ok(dbg.toolbox.splitConsole, "Split console is shown.");
+});
new file mode 100644
--- /dev/null
+++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-editor-highlight.js
@@ -0,0 +1,47 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+// Tests that the editor will always highight the right line, no
+// matter if the source text doesn't exist yet or even if the source
+// doesn't exist.
+
+add_task(function* () {
+  const dbg = yield initDebugger("doc-scripts.html");
+  const { selectors: { getSourceText }, getState } = dbg;
+  const sourceUrl = EXAMPLE_URL + "code-long.js";
+
+  // The source itself doesn't even exist yet, and using
+  // `selectSourceURL` will set a pending request to load this source
+  // and highlight a specific line.
+  dbg.actions.selectSourceURL(sourceUrl, { line: 66 });
+
+  // Wait for the source text to load and make sure we're in the right
+  // place.
+  yield waitForDispatch(dbg, "LOAD_SOURCE_TEXT");
+  assertHighlightLocation(dbg, "long.js", 66);
+
+  // Jump to line 16 and make sure the editor scrolled.
+  yield selectSource(dbg, "long.js", 16);
+  assertHighlightLocation(dbg, "long.js", 16);
+
+  // Make sure only one line is ever highlighted and the flash
+  // animation is cancelled on old lines.
+  yield selectSource(dbg, "long.js", 17);
+  yield selectSource(dbg, "long.js", 18);
+  assertHighlightLocation(dbg, "long.js", 18);
+  is(findAllElements(dbg, "highlightLine").length, 1,
+     "Only 1 line is highlighted");
+
+  // Test jumping to a line in a source that exists but hasn't been
+  // loaded yet.
+  yield waitForSources(dbg, "simple1.js");
+  selectSource(dbg, "simple1.js", 6);
+
+  // Make sure the source is in the loading state, wait for it to be
+  // fully loaded, and check the highlighted line.
+  const simple1 = findSource(dbg, "simple1.js");
+  ok(getSourceText(getState(), simple1.id).get("loading"));
+  yield waitForDispatch(dbg, "LOAD_SOURCE_TEXT");
+  ok(getSourceText(getState(), simple1.id).get("text"));
+  assertHighlightLocation(dbg, "simple1.js", 6);
+});
--- a/devtools/client/debugger/new/test/mochitest/browser_dbg-editor-select.js
+++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-editor-select.js
@@ -1,32 +1,32 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 // Tests that the editor highlights the correct location when the
 // debugger pauses
 
 // checks to see if the first breakpoint is visible
-function isBreakpointVisible(dbg) {
-  const bpLine = findElement(dbg, "breakpoint");
+function isElementVisible(dbg, elementName) {
+  const bpLine = findElement(dbg, elementName);
   const cm = findElement(dbg, "codeMirror");
-  ok(isVisibleWithin(cm, bpLine), "CodeMirror is scrolled to line");
+  return bpLine && isVisibleWithin(cm, bpLine);
 }
 
 add_task(function* () {
   const dbg = yield initDebugger(
     "doc-scripts.html",
     "simple1.js", "simple2.js", "long.js"
   );
   const { selectors: { getSelectedSource }, getState } = dbg;
   const simple1 = findSource(dbg, "simple1.js");
   const simple2 = findSource(dbg, "simple2.js");
 
   // Set the initial breakpoint.
-  yield addBreakpoint(dbg, simple1.id, 4);
+  yield addBreakpoint(dbg, simple1, 4);
   ok(!getSelectedSource(getState()), "No selected source");
 
   // Call the function that we set a breakpoint in.
   invokeInTab("main");
   yield waitForPaused(dbg);
   assertPausedLocation(dbg, simple1, 4);
 
   // Step through to another file and make sure it's paused in the
@@ -37,16 +37,16 @@ add_task(function* () {
   // Step back out to the initial file.
   yield stepOut(dbg);
   yield stepOut(dbg);
   assertPausedLocation(dbg, simple1, 5);
   yield resume(dbg);
 
   // Make sure that we can set a breakpoint on a line out of the
   // viewport, and that pausing there scrolls the editor to it.
-  const longSrc = findSource(dbg, "long.js");
-  yield addBreakpoint(dbg, longSrc.id, 66);
+  let longSrc = findSource(dbg, "long.js");
+  yield addBreakpoint(dbg, longSrc, 66);
 
   invokeInTab("testModel");
   yield waitForPaused(dbg);
   assertPausedLocation(dbg, longSrc, 66);
-  isBreakpointVisible(dbg);
+  ok(isElementVisible(dbg, "breakpoint"), "Breakpoint is visible");
 });
new file mode 100644
--- /dev/null
+++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-navigation.js
@@ -0,0 +1,42 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+function countSources(dbg) {
+  const sources = dbg.selectors.getSources(dbg.getState());
+  return sources.size;
+}
+
+/**
+ * Test navigating
+ * navigating while paused will reset the pause state and sources
+ */
+add_task(function* () {
+  const dbg = yield initDebugger(
+    "doc-script-switching.html",
+    "script-switching-01.js"
+  );
+
+  invokeInTab("firstCall");
+  yield waitForPaused(dbg);
+
+  yield navigate(dbg, "doc-scripts.html", "simple1.js", "long.js");
+  yield addBreakpoint(dbg, "simple1.js", 4);
+  invokeInTab("main");
+  yield waitForPaused(dbg);
+  assertPausedLocation(dbg, "simple1.js", 4);
+  is(countSources(dbg), 4, "4 sources are loaded.");
+
+  yield navigate(dbg, "about:blank");
+  yield waitForDispatch(dbg, "NAVIGATE");
+  is(countSources(dbg), 0, "0 sources are loaded.");
+
+  yield navigate(dbg,
+    "doc-scripts.html",
+    "simple1.js",
+    "simple2.js",
+    "long.js",
+    "scripts.html"
+  );
+
+  is(countSources(dbg), 4, "4 sources are loaded.");
+});
new file mode 100644
--- /dev/null
+++ b/devtools/client/debugger/new/test/mochitest/browser_dbg_keyboard-shortcuts.js
@@ -0,0 +1,49 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+/**
+ * Test keyboard shortcuts.
+ */
+
+function pressResume(dbg) {
+  pressKey(dbg, "resumeKey");
+  return waitForPaused(dbg);
+}
+
+function pressStepOver(dbg) {
+  pressKey(dbg, "stepOverKey");
+  return waitForPaused(dbg);
+}
+
+function pressStepIn(dbg) {
+  pressKey(dbg, "stepInKey");
+  return waitForPaused(dbg);
+}
+
+function pressStepOut(dbg) {
+  pressKey(dbg, "stepOutKey");
+  return waitForPaused(dbg);
+}
+
+add_task(function*() {
+  const dbg = yield initDebugger(
+    "doc-debugger-statements.html",
+    "debugger-statements.html"
+  );
+
+  yield reload(dbg);
+  yield waitForPaused(dbg);
+  assertPausedLocation(dbg, "debugger-statements.html", 8);
+
+  yield pressResume(dbg);
+  assertPausedLocation(dbg, "debugger-statements.html", 12);
+
+  yield pressStepIn(dbg);
+  assertPausedLocation(dbg, "debugger-statements.html", 13);
+
+  yield pressStepOut(dbg);
+  assertPausedLocation(dbg, "debugger-statements.html", 14);
+
+  yield pressStepOver(dbg);
+  assertPausedLocation(dbg, "debugger-statements.html", 9);
+});
rename from devtools/client/debugger/new/test/mochitest/examples/doc-script-switching-01.html
rename to devtools/client/debugger/new/test/mochitest/examples/doc-script-switching.html
--- a/devtools/client/debugger/new/test/mochitest/head.js
+++ b/devtools/client/debugger/new/test/mochitest/head.js
@@ -90,125 +90,151 @@ function waitForState(dbg, predicate) {
       if (predicate(dbg.store.getState())) {
         unsubscribe();
         resolve();
       }
     });
   });
 }
 
-function waitForMs(time) {
-  return new Promise(resolve => setTimeout(resolve, time));
+function waitForSources(dbg, ...sources) {
+  if(sources.length === 0) {
+    return Promise.resolve();
+  }
+
+  info("Waiting on sources: " + sources.join(", "));
+  const {selectors: {getSources}, store} = dbg;
+  return Promise.all(sources.map(url => {
+    function sourceExists(state) {
+      return getSources(state).some(s => s.get("url").includes(url));
+    }
+
+    if(!sourceExists(store.getState())) {
+      return waitForState(dbg, sourceExists);
+    }
+  }));
 }
 
 function assertPausedLocation(dbg, source, line) {
   const { selectors: { getSelectedSource, getPause }, getState } = dbg;
+  source = findSource(dbg, source);
 
-  // support passing in a partial url and fetching the source
-  if (typeof source == "string") {
-    source = findSource(dbg, source);
-  }
-
-  // check the selected source
+  // Check the selected source
   is(getSelectedSource(getState()).get("url"), source.url);
 
-  // check the pause location
+  // Check the pause location
   const location = getPause(getState()).getIn(["frame", "location"]);
   is(location.get("sourceId"), source.id);
   is(location.get("line"), line);
 
-  // check the debug line
+  // Check the debug line
   ok(dbg.win.cm.lineInfo(line - 1).wrapClass.includes("debug-line"),
+     "Line is highlighted as paused");
+}
+
+function assertHighlightLocation(dbg, source, line) {
+  const { selectors: { getSelectedSource, getPause }, getState } = dbg;
+  source = findSource(dbg, source);
+
+  // Check the selected source
+  is(getSelectedSource(getState()).get("url"), source.url);
+
+  // Check the highlight line
+  const lineEl = findElement(dbg, "highlightLine");
+  ok(lineEl, "Line is highlighted");
+  ok(isVisibleWithin(findElement(dbg, "codeMirror"), lineEl),
+     "Highlighted line is visible");
+  ok(dbg.win.cm.lineInfo(line - 1).wrapClass.includes("highlight-line"),
      "Line is highlighted");
 }
 
 function isPaused(dbg) {
   const { selectors: { getPause }, getState } = dbg;
   return !!getPause(getState());
 }
 
-const waitForPaused = Task.async(function* (dbg) {
-  // We want to make sure that we get both a real paused event and
-  // that the state is fully populated. The client may do some more
-  // work (call other client methods) before populating the state.
-  return Promise.all([
+function waitForPaused(dbg) {
+  return Task.spawn(function* () {
+    // We want to make sure that we get both a real paused event and
+    // that the state is fully populated. The client may do some more
+    // work (call other client methods) before populating the state.
     yield waitForThreadEvents(dbg, "paused"),
     yield waitForState(dbg, state => {
       const pause = dbg.selectors.getPause(state);
       // Make sure we have the paused state.
       if(!pause) {
         return false;
       }
       // Make sure the source text is completely loaded for the
       // source we are paused in.
       const sourceId = pause.getIn(["frame", "location", "sourceId"]);
       const sourceText = dbg.selectors.getSourceText(dbg.getState(), sourceId);
       return sourceText && !sourceText.get("loading");
-    })
-  ]);
-});
+    });
+  });
+};
 
-const initDebugger = Task.async(function* (url, ...sources) {
-  const toolbox = yield openNewTabAndToolbox(EXAMPLE_URL + url, "jsdebugger");
-  const win = toolbox.getPanel("jsdebugger").panelWin;
-  const store = win.Debugger.store;
-  const { getSources } = win.Debugger.selectors;
+function initDebugger(url, ...sources) {
+  return Task.spawn(function* () {
+    const toolbox = yield openNewTabAndToolbox(EXAMPLE_URL + url, "jsdebugger");
+    const win = toolbox.getPanel("jsdebugger").panelWin;
+    const store = win.Debugger.store;
+    const { getSources } = win.Debugger.selectors;
 
-  const dbg = {
-    actions: win.Debugger.actions,
-    selectors: win.Debugger.selectors,
-    getState: store.getState,
-    store: store,
-    client: win.Debugger.client,
-    toolbox: toolbox,
-    win: win
-  };
+    const dbg = {
+      actions: win.Debugger.actions,
+      selectors: win.Debugger.selectors,
+      getState: store.getState,
+      store: store,
+      client: win.Debugger.client,
+      toolbox: toolbox,
+      win: win
+    };
 
-  if(sources.length) {
-    // TODO: Extract this out to a utility function
-    info("Waiting on sources: " + sources.join(", "));
-    yield Promise.all(sources.map(url => {
-      function sourceExists(state) {
-        return getSources(state).some(s => s.get("url").includes(url));
-      }
+    yield waitForSources(dbg, ...sources);
 
-      if(!sourceExists(store.getState())) {
-        return waitForState(dbg, sourceExists);
-      }
-    }));
-  }
-
-  return dbg;
-});
+    return dbg;
+  });
+};
 
 window.resumeTest = undefined;
 function pauseTest() {
   info("Test paused. Invoke resumeTest to continue.");
   return new Promise(resolve => resumeTest = resolve);
 }
 
 // Actions
 
 function findSource(dbg, url) {
+  if(typeof url !== "string") {
+    // Support passing in a source object itelf all APIs that use this
+    // function support both styles
+    const source = url;
+    return source;
+  }
+
   const sources = dbg.selectors.getSources(dbg.getState());
   const source = sources.find(s => s.get("url").includes(url));
 
   if(!source) {
     throw new Error("Unable to find source: " + url);
   }
 
   return source.toJS();
 }
 
-function selectSource(dbg, url) {
+function selectSource(dbg, url, line) {
   info("Selecting source: " + url);
   const source = findSource(dbg, url);
-  dbg.actions.selectSource(source.id);
+  const hasText = !!dbg.selectors.getSourceText(dbg.getState(), source.id);
+  dbg.actions.selectSource(source.id, { line });
 
-  return waitForDispatch(dbg, "LOAD_SOURCE_TEXT");
+  if(!hasText) {
+    return waitForDispatch(dbg, "LOAD_SOURCE_TEXT");
+  }
 }
 
 function stepOver(dbg) {
   info("Stepping over");
   dbg.actions.stepOver();
   return waitForPaused(dbg);
 }
 
@@ -229,20 +255,31 @@ function resume(dbg) {
   dbg.actions.resume();
   return waitForThreadEvents(dbg, "resumed");
 }
 
 function reload(dbg) {
   return dbg.client.reload();
 }
 
-function addBreakpoint(dbg, sourceId, line, col) {
+function navigate(dbg, url, ...sources) {
+  dbg.client.navigate(url);
+  return waitForSources(dbg, ...sources)
+}
+
+function addBreakpoint(dbg, source, line, col) {
+  source = findSource(dbg, source);
+  const sourceId = source.id;
   return dbg.actions.addBreakpoint({ sourceId, line, col });
 }
 
+function removeBreakpoint(dbg, sourceId, line, col) {
+  return dbg.actions.removeBreakpoint({ sourceId, line, col });
+}
+
 function togglePauseOnExceptions(dbg,
   pauseOnExceptions, ignoreCaughtExceptions) {
 
   const command = dbg.actions.pauseOnExceptions(
     pauseOnExceptions,
     ignoreCaughtExceptions
   );
 
@@ -251,41 +288,61 @@ function togglePauseOnExceptions(dbg,
   }
 
   return command;
 }
 
 // Helpers
 // invoke a global function in the debugged tab
 function invokeInTab(fnc) {
+  info(`Invoking function ${fnc} in tab`);
   return ContentTask.spawn(gBrowser.selectedBrowser, fnc, function* (fnc) {
     content.wrappedJSObject[fnc](); // eslint-disable-line mozilla/no-cpows-in-tests, max-len
   });
 }
 
+const isLinux = Services.appinfo.OS === "Linux";
+const keyMappings = {
+  pauseKey: { code: "VK_F8" },
+  resumeKey: { code: "VK_F8" },
+  stepOverKey: { code: "VK_F10" },
+  stepInKey: { code: "VK_F11", modifiers: { ctrlKey: isLinux } },
+  stepOutKey: { code: "VK_F11", modifiers: { ctrlKey: isLinux, shiftKey: true } }
+};
+
+function pressKey(dbg, keyName) {
+  let keyEvent = keyMappings[keyName];
+  const { code, modifiers } = keyEvent;
+  return EventUtils.synthesizeKey(
+    code,
+    modifiers || {},
+    dbg.win
+  );
+}
 
 function isVisibleWithin(outerEl, innerEl) {
   const innerRect = innerEl.getBoundingClientRect();
   const outerRect = outerEl.getBoundingClientRect();
   return innerRect.top > outerRect.top &&
     innerRect.bottom < outerRect.bottom;
 }
 
 const selectors = {
   callStackHeader: ".call-stack-pane ._header",
   frame: index => `.frames ul li:nth-child(${index})`,
   gutter: i => `.CodeMirror-code *:nth-child(${i}) .CodeMirror-linenumber`,
   pauseOnExceptions: ".pause-exceptions",
   breakpoint: ".CodeMirror-code > .new-breakpoint",
+  highlightLine: ".CodeMirror-code > .highlight-line",
   codeMirror: ".CodeMirror",
   resume: ".resume.active",
   stepOver: ".stepOver.active",
   stepOut: ".stepOut.active",
   stepIn: ".stepIn.active"
-}
+};
 
 function getSelector(elementName, ...args) {
   let selector = selectors[elementName];
   if (!selector) {
     throw new Error(`The selector ${elementName} is not defined`);
   }
 
   if (typeof selector == "function") {
@@ -295,16 +352,21 @@ function getSelector(elementName, ...arg
   return selector;
 }
 
 function findElement(dbg, elementName, ...args) {
   const selector = getSelector(elementName, ...args);
   return dbg.win.document.querySelector(selector);
 }
 
+function findAllElements(dbg, elementName, ...args) {
+  const selector = getSelector(elementName, ...args);
+  return dbg.win.document.querySelectorAll(selector);
+}
+
 // click an element in the debugger
 function clickElement(dbg, elementName, ...args) {
   const selector = getSelector(elementName, ...args);
   const doc = dbg.win.document;
   return EventUtils.synthesizeMouseAtCenter(
     doc.querySelector(selector),
     {},
     dbg.win
--- a/devtools/client/locales/en-US/storage.properties
+++ b/devtools/client/locales/en-US/storage.properties
@@ -37,28 +37,16 @@ tree.labels.Cache=Cache Storage
 # each type of storage available through the Storage Tree to the side.
 table.headers.cookies.name=Name
 table.headers.cookies.path=Path
 table.headers.cookies.host=Domain
 table.headers.cookies.expires=Expires on
 table.headers.cookies.value=Value
 table.headers.cookies.lastAccessed=Last accessed on
 table.headers.cookies.creationTime=Created on
-# LOCALIZATION NOTE (table.headers.cookies.isHttpOnly):
-# This string is used in the header for the column which denotes whether a
-# cookie is HTTP only or not.
-table.headers.cookies.isHttpOnly=isHttpOnly
-# LOCALIZATION NOTE (table.headers.cookies.isSecure):
-# This string is used in the header for the column which denotes whether a
-# cookie can be accessed via a secure channel only or not.
-table.headers.cookies.isSecure=isSecure
-# LOCALIZATION NOTE (table.headers.cookies.isDomain):
-# This string is used in the header for the column which denotes whether a
-# cookie is a domain cookie only or not.
-table.headers.cookies.isDomain=isDomain
 
 table.headers.localStorage.name=Key
 table.headers.localStorage.value=Value
 
 table.headers.sessionStorage.name=Key
 table.headers.sessionStorage.value=Value
 
 table.headers.Cache.url=URL
--- a/devtools/client/shared/components/notification-box.css
+++ b/devtools/client/shared/components/notification-box.css
@@ -68,30 +68,28 @@
 
 .notificationbox .messageImage[data-type="critical"] {
   background-image: url("chrome://global/skin/icons/error-16.png");
 }
 
 /* Close button */
 
 .notificationbox .messageCloseButton {
-  /* Use odd value for the width so, the icon can be nicely h-centered.
-    This also means that the button is not perfect circle (its using
-    10x border radius), but it's less visible visual discrepency
-    than wrong centering of the icon */
-  width: 19px;
+  width: 20px;
   height: 20px;
   margin: 4px;
   margin-inline-end: 8px;
   background-image: url("chrome://devtools/skin/images/close.svg");
-  background-position: 3px center;
+  background-position: 3.45px 2.5px;
   background-color: transparent;
   background-repeat: no-repeat;
-  border-radius: 10px;
+  border-radius: 11px;
+  filter: invert(0);
 }
 
 .notificationbox .messageCloseButton:hover {
-  background-color: rgba(170, 170, 170, .2); /* --toolbar-tab-hover */
+  background-color: gray;
+  filter: invert(1);
 }
 
 .notificationbox .messageCloseButton:active {
   background-color: rgba(170, 170, 170, .4); /* --toolbar-tab-hover-active */
 }
--- a/devtools/client/storage/test/browser_storage_dynamic_updates.js
+++ b/devtools/client/storage/test/browser_storage_dynamic_updates.js
@@ -13,27 +13,27 @@ add_task(function* () {
   gUI.tree.expandAll();
 
   ok(gUI.sidebar.hidden, "Sidebar is initially hidden");
   yield selectTableItem("c1");
 
   // test that value is something initially
   let initialValue = [[
     {name: "c1", value: "1.2.3.4.5.6.7"},
-    {name: "c1.path", value: "/browser"}
+    {name: "c1.Path", value: "/browser"}
   ], [
     {name: "c1", value: "Array"},
     {name: "c1.0", value: "1"},
     {name: "c1.6", value: "7"}
   ]];
 
   // test that value is something initially
   let finalValue = [[
     {name: "c1", value: '{"foo": 4,"bar":6}'},
-    {name: "c1.path", value: "/browser"}
+    {name: "c1.Path", value: "/browser"}
   ], [
     {name: "c1", value: "Object"},
     {name: "c1.foo", value: "4"},
     {name: "c1.bar", value: "6"}
   ]];
   // Check that sidebar shows correct initial value
   yield findVariableViewProperties(initialValue[0], false);
   yield findVariableViewProperties(initialValue[1], true);
--- a/devtools/client/storage/test/browser_storage_values.js
+++ b/devtools/client/storage/test/browser_storage_values.js
@@ -14,31 +14,31 @@
 
 "use strict";
 
 const LONG_WORD = "a".repeat(1000);
 
 const testCases = [
   ["cs2", [
     {name: "cs2", value: "sessionCookie"},
-    {name: "cs2.path", value: "/"},
-    {name: "cs2.isDomain", value: "true"},
-    {name: "cs2.isHttpOnly", value: "false"},
-    {name: "cs2.host", value: ".example.org"},
-    {name: "cs2.expires", value: "Session"},
-    {name: "cs2.isSecure", value: "false"},
+    {name: "cs2.Path", value: "/"},
+    {name: "cs2.HostOnly", value: "false"},
+    {name: "cs2.HttpOnly", value: "false"},
+    {name: "cs2.Domain", value: ".example.org"},
+    {name: "cs2.Expires", value: "Session"},
+    {name: "cs2.Secure", value: "false"},
   ]],
   ["c1", [
     {name: "c1", value: JSON.stringify(["foo", "Bar", {foo: "Bar"}])},
-    {name: "c1.path", value: "/browser"},
-    {name: "c1.isDomain", value: "false"},
-    {name: "c1.isHttpOnly", value: "false"},
-    {name: "c1.host", value: "test1.example.org"},
-    {name: "c1.expires", value: new Date(2000000000000).toUTCString()},
-    {name: "c1.isSecure", value: "false"},
+    {name: "c1.Path", value: "/browser"},
+    {name: "c1.HostOnly", value: "true"},
+    {name: "c1.HttpOnly", value: "false"},
+    {name: "c1.Domain", value: "test1.example.org"},
+    {name: "c1.Expires", value: new Date(2000000000000).toUTCString()},
+    {name: "c1.Secure", value: "false"},
   ]],
   [null, [
     {name: "c1", value: "Array"},
     {name: "c1.0", value: "foo"},
     {name: "c1.1", value: "Bar"},
     {name: "c1.2", value: "Object"},
     {name: "c1.2.foo", value: "Bar"},
   ], true],
--- a/devtools/client/storage/ui.js
+++ b/devtools/client/storage/ui.js
@@ -45,16 +45,27 @@ const HIDDEN_COLUMNS = [
 
 const REASON = {
   NEW_ROW: "new-row",
   NEXT_50_ITEMS: "next-50-items",
   POPULATE: "populate",
   UPDATE: "update"
 };
 
+const COOKIE_KEY_MAP = {
+  path: "Path",
+  host: "Domain",
+  expires: "Expires",
+  isSecure: "Secure",
+  isHttpOnly: "HttpOnly",
+  isDomain: "HostOnly",
+  creationTime: "CreationTime",
+  lastAccessed: "LastAccessed"
+};
+
 // Maximum length of item name to show in context menu label - will be
 // trimmed with ellipsis if it's longer.
 const ITEM_NAME_MAX_LENGTH = 32;
 
 function addEllipsis(name) {
   if (name.length > ITEM_NAME_MAX_LENGTH) {
     return name.substr(0, ITEM_NAME_MAX_LENGTH) + ELLIPSIS;
   }
@@ -602,17 +613,19 @@ StorageUI.prototype = {
       let itemProps = Object.keys(item);
       if (itemProps.length > 3) {
         // Display any other information other than the item name and value
         // which may be available.
         let rawObject = Object.create(null);
         let otherProps = itemProps.filter(
           e => !["name", "value", "valueActor"].includes(e));
         for (let prop of otherProps) {
-          rawObject[prop] = item[prop];
+          let cookieProp = COOKIE_KEY_MAP[prop] || prop;
+          // The pseduo property of HostOnly refers to converse of isDomain property
+          rawObject[cookieProp] = (prop === "isDomain") ? !item[prop] : item[prop];
         }
         itemVar.populate(rawObject, {sorted: true});
         itemVar.twisty = true;
         itemVar.expanded = true;
       }
     } else {
       // Case when displaying IndexedDB db/object store properties.
       for (let key in item) {
@@ -772,21 +785,27 @@ StorageUI.prototype = {
         this.table.uniqueId = uniqueKey = f.name;
       }
 
       if (f.editable) {
         editableFields.push(f.name);
       }
 
       columns[f.name] = f.name;
+      let columnName;
       try {
-        columns[f.name] = L10N.getStr("table.headers." + type + "." + f.name);
+        columnName = L10N.getStr("table.headers." + type + "." + f.name);
       } catch (e) {
-        console.error("Unable to localize table header type:" + type +
-                      " key:" + f.name);
+        columnName = COOKIE_KEY_MAP[f.name];
+      }
+
+      if (!columnName) {
+        console.error("Unable to localize table header type:" + type + " key:" + f.name);
+      } else {
+        columns[f.name] = columnName;
       }
     });
 
     this.table.setColumns(columns, null, HIDDEN_COLUMNS);
     this.hideSidebar();
 
     yield this.makeFieldsEditable(editableFields);
   },
--- a/devtools/client/themes/common.css
+++ b/devtools/client/themes/common.css
@@ -586,19 +586,19 @@ checkbox:-moz-focusring {
 /* The spacing is accomplished with a padding on the searchbox */
 .devtools-searchbox > .devtools-textinput,
 .devtools-searchbox > .devtools-searchinput,
 .devtools-searchbox > .devtools-filterinput {
   margin-left: 0;
   margin-right: 0;
 }
 
-.devtools-searchbox > .devtools-textinput:-moz-focusring,
-.devtools-searchbox > .devtools-searchinput:-moz-focusring,
-.devtools-searchbox > .devtools-filterinput:-moz-focusring {
+.devtools-textinput:focus,
+.devtools-searchinput:focus,
+.devtools-filterinput:focus {
   border-color: var(--theme-focus-border-color-textbox);
   box-shadow: var(--theme-focus-box-shadow-textbox);
   transition: all 0.2s ease-in-out;
   outline: none;
 }
 
 /* Don't add 'double spacing' for inputs that are at beginning / end
    of a toolbar (since the toolbar has it's own spacing). */
--- a/devtools/client/themes/images/close.svg
+++ b/devtools/client/themes/images/close.svg
@@ -1,6 +1,6 @@
 <!-- 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/. -->
-<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="#0b0b0b">
+<svg width="17" height="17" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" fill="#0b0b0b">
   <path d="M8.707 8l4.23 4.23a.5.5 0 1 1-.707.707L8 8.707l-4.23 4.23a.5.5 0 1 1-.707-.707L7.293 8l-4.23-4.23a.5.5 0 1 1 .707-.707L8 7.293l4.23-4.23a.5.5 0 0 1 .707.707L8.707 8z" fill-rule="evenodd"/>
 </svg>
--- a/devtools/client/themes/responsivedesign.inc.css
+++ b/devtools/client/themes/responsivedesign.inc.css
@@ -164,16 +164,18 @@
 }
 
 .devtools-responsiveui-close {
   list-style-image: url("chrome://devtools/skin/images/close.svg");
 }
 
 .devtools-responsiveui-close > image {
   filter: invert(1);
+  padding-inline-start: 3px;
+  padding-top: 2px;
 }
 
 .devtools-responsiveui-rotate {
   list-style-image: url("chrome://devtools/skin/images/responsivemode/responsiveui-rotate.png");
 }
 
 @media (min-resolution: 1.1dppx) {
   .devtools-responsiveui-rotate {
--- a/dom/base/ImageEncoder.cpp
+++ b/dom/base/ImageEncoder.cpp
@@ -364,16 +364,20 @@ ImageEncoder::ExtractDataInternal(const 
     return NS_ERROR_INVALID_ARG;
   }
 
   nsCOMPtr<nsIInputStream> imgStream;
 
   // get image bytes
   nsresult rv;
   if (aImageBuffer) {
+    if (BufferSizeFromDimensions(aSize.width, aSize.height, 4) == 0) {
+      return NS_ERROR_INVALID_ARG;
+    }
+
     rv = ImageEncoder::GetInputStream(
       aSize.width,
       aSize.height,
       aImageBuffer,
       aFormat,
       aEncoder,
       nsPromiseFlatString(aOptions).get(),
       getter_AddRefs(imgStream));
@@ -412,16 +416,20 @@ ImageEncoder::ExtractDataInternal(const 
       rv = aEncoder->InitFromData(data.Elements(),
                                   aSize.width * aSize.height * 4,
                                   aSize.width,
                                   aSize.height,
                                   aSize.width * 4,
                                   imgIEncoder::INPUT_FORMAT_HOSTARGB,
                                   aOptions);
     } else {
+      if (BufferSizeFromDimensions(aSize.width, aSize.height, 4) == 0) {
+        return NS_ERROR_INVALID_ARG;
+      }
+
       RefPtr<gfx::DataSourceSurface> dataSurface;
       RefPtr<layers::Image> image(aImage);
       dataSurface = GetBRGADataSourceSurfaceSync(image.forget());
 
       DataSourceSurface::MappedSurface map;
       if (!dataSurface->Map(gfx::DataSourceSurface::MapType::READ, &map)) {
         return NS_ERROR_INVALID_ARG;
       }
@@ -434,22 +442,20 @@ ImageEncoder::ExtractDataInternal(const 
                                   aOptions);
       dataSurface->Unmap();
     }
 
     if (NS_SUCCEEDED(rv)) {
       imgStream = do_QueryInterface(aEncoder);
     }
   } else {
-    CheckedInt32 requiredBytes = CheckedInt32(aSize.width) * CheckedInt32(aSize.height) * 4;
-    if (MOZ_UNLIKELY(!requiredBytes.isValid())) {
+    if (BufferSizeFromDimensions(aSize.width, aSize.height, 4) == 0) {
       return NS_ERROR_INVALID_ARG;
     }
 
-
     // no context, so we have to encode an empty image
     // note that if we didn't have a current context, the spec says we're
     // supposed to just return transparent black pixels of the canvas
     // dimensions.
     RefPtr<DataSourceSurface> emptyCanvas =
       Factory::CreateDataSourceSurfaceWithStride(IntSize(aSize.width, aSize.height),
                                                  SurfaceFormat::B8G8R8A8,
                                                  4 * aSize.width, true);
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -1884,17 +1884,16 @@ const InterfaceShimEntry kInterfaceShimM
   { "nsIDOMNSEvent", "Event" },
   { "nsIDOMKeyEvent", "KeyEvent" },
   { "nsIDOMMouseEvent", "MouseEvent" },
   { "nsIDOMMouseScrollEvent", "MouseScrollEvent" },
   { "nsIDOMMutationEvent", "MutationEvent" },
   { "nsIDOMSimpleGestureEvent", "SimpleGestureEvent" },
   { "nsIDOMUIEvent", "UIEvent" },
   { "nsIDOMHTMLMediaElement", "HTMLMediaElement" },
-  { "nsIDOMMediaError", "MediaError" },
   { "nsIDOMOfflineResourceList", "OfflineResourceList" },
   { "nsIDOMRange", "Range" },
   { "nsIDOMSVGLength", "SVGLength" },
   { "nsIDOMNodeFilter", "NodeFilter" },
   { "nsIDOMXPathResult", "XPathResult" } };
 
 static nsresult
 LookupComponentsShim(JSContext *cx, JS::Handle<JSObject*> global,
--- a/dom/canvas/CanvasRenderingContext2D.cpp
+++ b/dom/canvas/CanvasRenderingContext2D.cpp
@@ -5244,18 +5244,23 @@ CanvasRenderingContext2D::DrawWindow(nsG
       (!mBufferProvider || mBufferProvider->GetType() != LayersBackend::LAYERS_CLIENT))
   {
     thebes = gfxContext::CreateOrNull(mTarget);
     MOZ_ASSERT(thebes); // already checked the draw target above
                         // (in SupportsAzureContentForDrawTarget)
     thebes->SetMatrix(gfxMatrix(matrix._11, matrix._12, matrix._21,
                                 matrix._22, matrix._31, matrix._32));
   } else {
+    IntSize dtSize = IntSize::Ceil(sw, sh);
+    if (!Factory::AllowedSurfaceSize(dtSize)) {
+      aError.Throw(NS_ERROR_FAILURE);
+      return;
+    }
     drawDT =
-      gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget(IntSize::Ceil(sw, sh),
+      gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget(dtSize,
                                                                    SurfaceFormat::B8G8R8A8);
     if (!drawDT || !drawDT->IsValid()) {
       aError.Throw(NS_ERROR_FAILURE);
       return;
     }
 
     thebes = gfxContext::CreateOrNull(drawDT);
     MOZ_ASSERT(thebes); // alrady checked the draw target above
@@ -5271,16 +5276,22 @@ CanvasRenderingContext2D::DrawWindow(nsG
 
   if (drawDT) {
     RefPtr<SourceSurface> snapshot = drawDT->Snapshot();
     if (NS_WARN_IF(!snapshot)) {
       aError.Throw(NS_ERROR_FAILURE);
       return;
     }
     RefPtr<DataSourceSurface> data = snapshot->GetDataSurface();
+    if (!data || !Factory::AllowedSurfaceSize(data->GetSize())) {
+      gfxCriticalError() << "Unexpected invalid data source surface " <<
+        (data ? data->GetSize() : IntSize(0,0));
+      aError.Throw(NS_ERROR_FAILURE);
+      return;
+    }
 
     DataSourceSurface::MappedSurface rawData;
     if (NS_WARN_IF(!data->Map(DataSourceSurface::READ, &rawData))) {
         aError.Throw(NS_ERROR_FAILURE);
         return;
     }
     RefPtr<SourceSurface> source =
       mTarget->CreateSourceSurfaceFromData(rawData.mData,
--- a/dom/canvas/ImageBitmapRenderingContext.cpp
+++ b/dom/canvas/ImageBitmapRenderingContext.cpp
@@ -104,17 +104,18 @@ ImageBitmapRenderingContext::MatchWithIn
   }
 
   RefPtr<DrawTarget> dt =
     Factory::CreateDrawTargetForData(BackendType::CAIRO,
                                      map.GetData(),
                                      temp->GetSize(),
                                      map.GetStride(),
                                      temp->GetFormat());
-  if (!dt) {
+  if (!dt || !dt->IsValid()) {
+    gfxWarning() << "ImageBitmapRenderingContext::MatchWithIntrinsicSize failed";
     return nullptr;
   }
 
 
   dt->ClearRect(Rect(0, 0, mWidth, mHeight));
   dt->CopySurface(surface,
                   IntRect(0, 0, surface->GetSize().width,
                                 surface->GetSize().height),
--- a/dom/canvas/WebGLProgram.cpp
+++ b/dom/canvas/WebGLProgram.cpp
@@ -170,16 +170,20 @@ QueryProgramInfo(WebGLProgram* prog, gl:
         nsAutoCString mappedName;
         mappedName.SetLength(maxAttribLenWithNull - 1);
 
         GLsizei lengthWithoutNull = 0;
         GLint elemCount = 0; // `size`
         GLenum elemType = 0; // `type`
         gl->fGetActiveAttrib(prog->mGLName, i, mappedName.Length()+1, &lengthWithoutNull,
                              &elemCount, &elemType, mappedName.BeginWriting());
+        GLenum error = gl->fGetError();
+        if (error != LOCAL_GL_NO_ERROR) {
+            gfxCriticalNote << "Failed to do glGetActiveAttrib: " << error;
+        }
 
         mappedName.SetLength(lengthWithoutNull);
 
         // Attribs can't be arrays, so we can skip some of the mess we have in the Uniform
         // path.
         nsDependentCString userName;
         if (!prog->FindAttribUserNameByMappedName(mappedName, &userName))
             userName.Rebind(mappedName, 0);
--- a/dom/canvas/test/webgl-conf/generated-mochitest.ini
+++ b/dom/canvas/test/webgl-conf/generated-mochitest.ini
@@ -4649,17 +4649,17 @@ skip-if = (os == 'win') || (os == 'andro
 skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1'))
 [generated/test_2_conformance__canvas__draw-static-webgl-to-multiple-canvas-test.html]
 skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1'))
 [generated/test_2_conformance__canvas__draw-webgl-to-canvas-test.html]
 skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1'))
 [generated/test_2_conformance__canvas__drawingbuffer-hd-dpi-test.html]
 skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1'))
 [generated/test_2_conformance__canvas__drawingbuffer-static-canvas-test.html]
-skip-if = (os == 'win' && os_version == '6.2') || (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1'))
+skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1'))
 [generated/test_2_conformance__canvas__drawingbuffer-test.html]
 skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1'))
 [generated/test_2_conformance__canvas__framebuffer-bindings-affected-by-to-data-url.html]
 skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1'))
 [generated/test_2_conformance__canvas__framebuffer-bindings-unaffected-on-resize.html]
 skip-if = (os == 'android' || os == 'linux' || (os == 'win' && os_version == '5.1'))
 [generated/test_2_conformance__canvas__rapid-resizing.html]
 fail-if = (os == 'win' && os_version == '5.1')
--- a/dom/canvas/test/webgl-conf/mochitest-errata.ini
+++ b/dom/canvas/test/webgl-conf/mochitest-errata.ini
@@ -653,19 +653,16 @@ skip-if = (os == 'win' && os_version == 
 # Failure on win7 but got passed on win7 vm
 skip-if = (os == 'win' && os_version == '6.1')
 [generated/test_2_conformance__glsl__constructors__glsl-construct-vec4.html]
 # Failure on win7 but got passed on win7 vm
 skip-if = (os == 'win' && os_version == '6.1')
 [generated/test_2_conformance__textures__misc__tex-image-and-sub-image-2d-with-array-buffer-view.html]
 # Failure on win7 but got passed on win7 vm
 skip-if = (os == 'win' && os_version == '6.1')
-[generated/test_2_conformance__canvas__drawingbuffer-static-canvas-test.html]
-# Framebuffer size can't be GL_MAX_RENDERBUFFER_SIZE
-skip-if = (os == 'win' && os_version == '6.2')
 [generated/test_2_conformance2__transform_feedback__transform_feedback.html]
 fail-if = (os == 'win' && (os_version == '6.1' || os_version == '6.2' || os_version == '10.0'))
 
 ####################
 # failure on Windows
 [generated/test_2_conformance__canvas__rapid-resizing.html]
 fail-if = (os == 'win' && os_version == '5.1')
 [generated/test_conformance__glsl__bugs__floor-div-cos-should-not-truncate.html]
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -80,16 +80,17 @@
 
 #include "AudioChannelService.h"
 
 #include "mozilla/dom/power/PowerManagerService.h"
 #include "mozilla/dom/WakeLock.h"
 
 #include "mozilla/dom/AudioTrack.h"
 #include "mozilla/dom/AudioTrackList.h"
+#include "mozilla/dom/MediaErrorBinding.h"
 #include "mozilla/dom/VideoTrack.h"
 #include "mozilla/dom/VideoTrackList.h"
 #include "mozilla/dom/TextTrack.h"
 #include "nsIContentPolicy.h"
 #include "mozilla/Telemetry.h"
 #include "DecoderDoctorDiagnostics.h"
 
 #include "ImageContainer.h"
@@ -157,16 +158,22 @@ static const double MIN_PLAYBACKRATE = 0
 static const double MAX_PLAYBACKRATE = 5.0;
 // These are the limits beyonds which SoundTouch does not perform too well and when
 // speech is hard to understand anyway.
 // Threshold above which audio is muted
 static const double THRESHOLD_HIGH_PLAYBACKRATE_AUDIO = 4.0;
 // Threshold under which audio is muted
 static const double THRESHOLD_LOW_PLAYBACKRATE_AUDIO = 0.5;
 
+// Media error values.  These need to match the ones in MediaError.webidl.
+static const unsigned short MEDIA_ERR_ABORTED = 1;
+static const unsigned short MEDIA_ERR_NETWORK = 2;
+static const unsigned short MEDIA_ERR_DECODE = 3;
+static const unsigned short MEDIA_ERR_SRC_NOT_SUPPORTED = 4;
+
 // Under certain conditions there may be no-one holding references to
 // a media element from script, DOM parent, etc, but the element may still
 // fire meaningful events in the future so we can't destroy it yet:
 // 1) If the element is delaying the load event (or would be, if it were
 // in a document), then events up to loadeddata or error could be fired,
 // so we need to stay alive.
 // 2) If the element is not paused and playback has not ended, then
 // we will (or might) play, sending timeupdate and ended events and possibly
@@ -866,23 +873,16 @@ HTMLMediaElement::SetMozSrcObject(DOMMed
 
 NS_IMETHODIMP HTMLMediaElement::GetMozAutoplayEnabled(bool *aAutoplayEnabled)
 {
   *aAutoplayEnabled = mAutoplayEnabled;
 
   return NS_OK;
 }
 
-NS_IMETHODIMP HTMLMediaElement::GetError(nsIDOMMediaError * *aError)
-{
-  NS_IF_ADDREF(*aError = mError);
-
-  return NS_OK;
-}
-
 bool
 HTMLMediaElement::Ended()
 {
   if (MediaStream* stream = GetSrcMediaStream()) {
     return stream->IsFinished();
   }
 
   return mDecoder && mDecoder->IsEnded();
@@ -1040,17 +1040,17 @@ void HTMLMediaElement::AbortExistingLoad
   mPendingEvents.Clear();
 }
 
 void HTMLMediaElement::NoSupportedMediaSourceError()
 {
   NS_ASSERTION(mNetworkState == NETWORK_LOADING,
                "Not loading during source selection?");
 
-  mError = new MediaError(this, nsIDOMMediaError::MEDIA_ERR_SRC_NOT_SUPPORTED);
+  mError = new MediaError(this, MEDIA_ERR_SRC_NOT_SUPPORTED);
   ChangeNetworkState(nsIDOMHTMLMediaElement::NETWORK_NO_SOURCE);
   DispatchAsyncEvent(NS_LITERAL_STRING("error"));
   ChangeDelayLoadStatus(false);
   UpdateAudioChannelPlayingState();
   OpenUnsupportedMediaWithExtenalAppIfNeeded();
 }
 
 typedef void (HTMLMediaElement::*SyncSectionFn)();
@@ -4411,17 +4411,17 @@ void HTMLMediaElement::FirstFrameLoaded(
   }
 }
 
 void HTMLMediaElement::NetworkError()
 {
   if (mDecoder) {
     ShutdownDecoder();
   }
-  Error(nsIDOMMediaError::MEDIA_ERR_NETWORK);
+  Error(MEDIA_ERR_NETWORK);
 }
 
 void HTMLMediaElement::DecodeError(const MediaResult& aError)
 {
   nsAutoString src;
   GetCurrentSrc(src);
   const char16_t* params[] = { src.get() };
   ReportLoadError("MediaLoadDecodeError", params, ArrayLength(params));
@@ -4438,37 +4438,37 @@ void HTMLMediaElement::DecodeError(const
     mError = nullptr;
     if (mSourceLoadCandidate) {
       DispatchAsyncSourceError(mSourceLoadCandidate);
       QueueLoadFromSourceTask();
     } else {
       NS_WARNING("Should know the source we were loading from!");
     }
   } else {
-    Error(nsIDOMMediaError::MEDIA_ERR_DECODE, aError);
+    Error(MEDIA_ERR_DECODE, aError);
   }
 }
 
 bool HTMLMediaElement::HasError() const
 {
   return GetError();
 }
 
 void HTMLMediaElement::LoadAborted()
 {
-  Error(nsIDOMMediaError::MEDIA_ERR_ABORTED);
+  Error(MEDIA_ERR_ABORTED);
 }
 
 void HTMLMediaElement::Error(uint16_t aErrorCode,
                              const MediaResult& aErrorDetails)
 {
-  NS_ASSERTION(aErrorCode == nsIDOMMediaError::MEDIA_ERR_DECODE ||
-               aErrorCode == nsIDOMMediaError::MEDIA_ERR_NETWORK ||
-               aErrorCode == nsIDOMMediaError::MEDIA_ERR_ABORTED,
-               "Only use nsIDOMMediaError codes!");
+  NS_ASSERTION(aErrorCode == MEDIA_ERR_DECODE ||
+               aErrorCode == MEDIA_ERR_NETWORK ||
+               aErrorCode == MEDIA_ERR_ABORTED,
+               "Only use MediaError codes!");
 
   // Since we have multiple paths calling into DecodeError, e.g.
   // MediaKeys::Terminated and EMEH264Decoder::Error. We should take the 1st
   // one only in order not to fire multiple 'error' events.
   if (mError) {
     return;
   }
   nsCString message;
@@ -6483,20 +6483,19 @@ HTMLMediaElement::IsAudible() const
 
 bool
 HTMLMediaElement::HaveFailedWithSourceNotSupportedError() const
 {
   if (!mError) {
     return false;
   }
 
-  uint16_t errorCode;
-  mError->GetCode(&errorCode);
+  uint16_t errorCode = mError->Code();
   return (mNetworkState == nsIDOMHTMLMediaElement::NETWORK_NO_SOURCE &&
-          errorCode == nsIDOMMediaError::MEDIA_ERR_SRC_NOT_SUPPORTED);
+          errorCode == MEDIA_ERR_SRC_NOT_SUPPORTED);
 }
 
 void
 HTMLMediaElement::OpenUnsupportedMediaWithExtenalAppIfNeeded()
 {
   if (!Preferences::GetBool("media.openUnsupportedTypeWithExternalApp")) {
     return;
   }
--- a/dom/html/MediaError.cpp
+++ b/dom/html/MediaError.cpp
@@ -12,40 +12,31 @@ namespace mozilla {
 namespace dom {
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(MediaError, mParent)
 NS_IMPL_CYCLE_COLLECTING_ADDREF(MediaError)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(MediaError)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(MediaError)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
-  NS_INTERFACE_MAP_ENTRY(nsIDOMMediaError)
-  NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMMediaError)
+  NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 MediaError::MediaError(HTMLMediaElement* aParent, uint16_t aCode,
                        const nsACString& aMessage)
   : mParent(aParent)
   , mCode(aCode)
   , mMessage(aMessage)
 {
 }
 
-NS_IMETHODIMP MediaError::GetCode(uint16_t* aCode)
-{
-  if (aCode)
-    *aCode = Code();
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP MediaError::GetMessage(nsAString& aResult)
+void
+MediaError::GetMessage(nsAString& aResult) const
 {
   CopyUTF8toUTF16(mMessage, aResult);
-  return NS_OK;
 }
 
 JSObject*
 MediaError::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
   return MediaErrorBinding::Wrap(aCx, this, aGivenProto);
 }
 
--- a/dom/html/MediaError.h
+++ b/dom/html/MediaError.h
@@ -2,53 +2,51 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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_MediaError_h
 #define mozilla_dom_MediaError_h
 
-#include "nsIDOMMediaError.h"
 #include "mozilla/dom/HTMLMediaElement.h"
 #include "nsWrapperCache.h"
 #include "nsISupports.h"
 #include "mozilla/Attributes.h"
 
 namespace mozilla {
 namespace dom {
 
-class MediaError final : public nsIDOMMediaError,
+class MediaError final : public nsISupports,
                          public nsWrapperCache
 {
   ~MediaError() {}
 
 public:
   MediaError(HTMLMediaElement* aParent, uint16_t aCode,
              const nsACString& aMessage = nsCString());
 
   // nsISupports
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MediaError)
 
-  // nsIDOMMediaError
-  NS_DECL_NSIDOMMEDIAERROR
-
   HTMLMediaElement* GetParentObject() const
   {
     return mParent;
   }
 
   virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
 
   uint16_t Code() const
   {
     return mCode;
   }
 
+  void GetMessage(nsAString& aResult) const;
+
 private:
   RefPtr<HTMLMediaElement> mParent;
 
   // Error code
   const uint16_t mCode;
   // Error details;
   const nsCString mMessage;
 };
--- a/dom/interfaces/html/moz.build
+++ b/dom/interfaces/html/moz.build
@@ -46,17 +46,16 @@ XPIDL_SOURCES += [
     'nsIDOMHTMLQuoteElement.idl',
     'nsIDOMHTMLScriptElement.idl',
     'nsIDOMHTMLSelectElement.idl',
     'nsIDOMHTMLSourceElement.idl',
     'nsIDOMHTMLStyleElement.idl',
     'nsIDOMHTMLTableCellElement.idl',
     'nsIDOMHTMLTextAreaElement.idl',
     'nsIDOMHTMLUListElement.idl',
-    'nsIDOMMediaError.idl',
     'nsIDOMMozBrowserFrame.idl',
     'nsIDOMTimeRanges.idl',
     'nsIDOMValidityState.idl',
     'nsIMozBrowserFrame.idl',
 ]
 
 XPIDL_MODULE = 'dom_html'
 
--- a/dom/interfaces/html/nsIDOMHTMLMediaElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLMediaElement.idl
@@ -1,16 +1,15 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* 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 "nsIDOMHTMLElement.idl"
-#include "nsIDOMMediaError.idl"
 #include "nsIDOMTimeRanges.idl"
 
 /**
  * The nsIDOMHTMLMediaElement interface is an interface to be implemented by the HTML
  * <audio> and <video> elements.
  *
  * For more information on this interface, please see
  * http://www.whatwg.org/specs/web-apps/current-work/#htmlmediaelement
@@ -26,19 +25,16 @@
 #include "Visibility.h"
 %}
 
 native Visibility(mozilla::Visibility);
 
 [uuid(c041d76c-15ce-47ad-b61d-e8755a6db638)]
 interface nsIDOMHTMLMediaElement : nsISupports
 {
-  // error state
-  readonly attribute nsIDOMMediaError error;
-
   // network state
            attribute DOMString src;
   readonly attribute DOMString currentSrc;
   const unsigned short NETWORK_EMPTY = 0;
   const unsigned short NETWORK_IDLE = 1;
   const unsigned short NETWORK_LOADING = 2;
   const unsigned short NETWORK_NO_SOURCE = 3;
   readonly attribute unsigned short networkState;
deleted file mode 100644
--- a/dom/interfaces/html/nsIDOMMediaError.idl
+++ /dev/null
@@ -1,29 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* 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 "domstubs.idl"
-
-[uuid(7bd8c29f-8a76-453f-9373-79f820f2dc01)]
-interface nsIDOMMediaError : nsISupports
-{
-  /* The download of the media resource was aborted by
-     the user agent at the user's requet */
-  const unsigned short MEDIA_ERR_ABORTED = 1;
-
-  /* A network error of some description caused the
-     user agent to stop downloading the media resource */
-  const unsigned short MEDIA_ERR_NETWORK = 2;
-
-  /* An error of some description occurred while decoding
-     the media resource */
-  const unsigned short MEDIA_ERR_DECODE  = 3;
-
-  /* No suitable media resource could be found */
-  const unsigned short MEDIA_ERR_SRC_NOT_SUPPORTED = 4;
-
-  readonly attribute unsigned short code;
-
-  readonly attribute DOMString message;
-};
--- a/dom/media/eme/MediaKeys.h
+++ b/dom/media/eme/MediaKeys.h
@@ -2,17 +2,16 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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_mediakeys_h__
 #define mozilla_dom_mediakeys_h__
 
-#include "nsIDOMMediaError.h"
 #include "nsWrapperCache.h"
 #include "nsISupports.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/RefPtr.h"
 #include "nsCOMPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsRefPtrHashtable.h"
 #include "mozilla/dom/Promise.h"
--- a/dom/media/webaudio/moz.build
+++ b/dom/media/webaudio/moz.build
@@ -112,17 +112,17 @@ UNIFIED_SOURCES += [
     'StereoPannerNode.cpp',
     'ThreeDPoint.cpp',
     'WaveShaperNode.cpp',
     'WebAudioUtils.cpp',
 ]
 
 if CONFIG['CPU_ARCH'] == 'arm' and CONFIG['BUILD_ARM_NEON']:
     SOURCES += ['AudioNodeEngineNEON.cpp']
-    SOURCES['AudioNodeEngineNEON.cpp'].flags += ['-mfpu=neon']
+    SOURCES['AudioNodeEngineNEON.cpp'].flags += CONFIG['NEON_FLAGS']
     LOCAL_INCLUDES += [
         '/media/openmax_dl/dl/api/'
     ]
 
 # Are we targeting x86 or x64?  If so, build SSE2 files.
 if CONFIG['INTEL_ARCHITECTURE']:
     SOURCES += ['AudioNodeEngineSSE2.cpp']
     DEFINES['USE_SSE2'] = True
--- a/dom/media/webrtc/MediaEngineWebRTC.cpp
+++ b/dom/media/webrtc/MediaEngineWebRTC.cpp
@@ -74,16 +74,19 @@ void AudioInputCubeb::UpdateDeviceList()
 
   // Calculate translation from existing mDevices to new devices. Note we
   // never end up with less devices than before, since people have
   // stashed indexes.
   // For some reason the "fake" device for automation is marked as DISABLED,
   // so white-list it.
   mDefaultDevice = -1;
   for (uint32_t i = 0; i < devices->count; i++) {
+    LOG(("Cubeb device %u: type 0x%x, state 0x%x, name %s, id %p",
+         i, devices->device[i]->type, devices->device[i]->state,
+         devices->device[i]->friendly_name, devices->device[i]->device_id));
     if (devices->device[i]->type == CUBEB_DEVICE_TYPE_INPUT && // paranoia
         (devices->device[i]->state == CUBEB_DEVICE_STATE_ENABLED ||
          (devices->device[i]->state == CUBEB_DEVICE_STATE_DISABLED &&
           devices->device[i]->friendly_name &&
           strcmp(devices->device[i]->friendly_name, "Sine source at 440 Hz") == 0)))
     {
       auto j = mDeviceNames->IndexOf(devices->device[i]->device_id);
       if (j != nsTArray<nsCString>::NoIndex) {
@@ -96,16 +99,17 @@ void AudioInputCubeb::UpdateDeviceList()
       }
       if (devices->device[i]->preferred & CUBEB_DEVICE_PREF_VOICE) {
         // There can be only one... we hope
         NS_ASSERTION(mDefaultDevice == -1, "multiple default cubeb input devices!");
         mDefaultDevice = i;
       }
     }
   }
+  LOG(("Cubeb default input device %d", mDefaultDevice));
   StaticMutexAutoLock lock(sMutex);
   // swap state
   if (mDevices) {
     cubeb_device_collection_destroy(mDevices);
   }
   mDevices = devices;
 }
 
--- a/dom/plugins/ipc/PluginInstanceChild.cpp
+++ b/dom/plugins/ipc/PluginInstanceChild.cpp
@@ -3791,19 +3791,23 @@ PluginInstanceChild::PaintRectToSurface(
                                               imageSurface->Data(),
                                               imageSurface->GetSize(),
                                               imageSurface->Stride(),
                                               SurfaceFormat::B8G8R8A8);
       } else {
         // Copy helper surface content to target
         dt = CreateDrawTargetForSurface(aSurface);
       }
-      RefPtr<SourceSurface> surface =
-        gfxPlatform::GetSourceSurfaceForSurface(dt, renderSurface);
-      dt->CopySurface(surface, aRect, aRect.TopLeft());
+      if (dt && dt->IsValid()) {
+          RefPtr<SourceSurface> surface =
+              gfxPlatform::GetSourceSurfaceForSurface(dt, renderSurface);
+          dt->CopySurface(surface, aRect, aRect.TopLeft());
+      } else {
+          gfxWarning() << "PluginInstanceChild::PaintRectToSurface failure";
+      }
     }
 }
 
 void
 PluginInstanceChild::PaintRectWithAlphaExtraction(const nsIntRect& aRect,
                                                   gfxASurface* aSurface)
 {
     MOZ_ASSERT(aSurface->GetContentType() == gfxContentType::COLOR_ALPHA,
--- a/dom/webidl/MediaError.webidl
+++ b/dom/webidl/MediaError.webidl
@@ -7,16 +7,17 @@
  * http://www.whatwg.org/html/#mediaerror
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
 interface MediaError {
+  // Keep these constants in sync with the ones defined in HTMLMediaElement.h
   const unsigned short MEDIA_ERR_ABORTED = 1;
   const unsigned short MEDIA_ERR_NETWORK = 2;
   const unsigned short MEDIA_ERR_DECODE = 3;
   const unsigned short MEDIA_ERR_SRC_NOT_SUPPORTED = 4;
 
   [Constant]
   readonly attribute unsigned short code;
   [Pref="dom.MediaError.message.enabled"]
--- a/dom/webidl/MimeTypeArray.webidl
+++ b/dom/webidl/MimeTypeArray.webidl
@@ -1,13 +1,15 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/.
  */
 
-[LegacyUnenumerableNamedProperties]
+// [LegacyUnenumerableNamedProperties]
+// Named properties enumerable for now; see
+// https://bugzilla.mozilla.org/show_bug.cgi?id=1270364
 interface MimeTypeArray {
   readonly attribute unsigned long length;
 
   getter MimeType? item(unsigned long index);
   getter MimeType? namedItem(DOMString name);
 };
--- a/dom/webidl/Plugin.webidl
+++ b/dom/webidl/Plugin.webidl
@@ -1,15 +1,17 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/.
  */
 
-[LegacyUnenumerableNamedProperties]
+// [LegacyUnenumerableNamedProperties]
+// Named properties enumerable for now; see
+// https://bugzilla.mozilla.org/show_bug.cgi?id=1270366
 interface Plugin {
   readonly attribute DOMString description;
   readonly attribute DOMString filename;
   readonly attribute DOMString version;
   readonly attribute DOMString name;
 
   readonly attribute unsigned long length;
   getter MimeType? item(unsigned long index);
--- a/dom/webidl/PluginArray.webidl
+++ b/dom/webidl/PluginArray.webidl
@@ -1,15 +1,17 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/.
  */
 
-[LegacyUnenumerableNamedProperties]
+// [LegacyUnenumerableNamedProperties]
+// Named properties enumerable for now; see
+// https://bugzilla.mozilla.org/show_bug.cgi?id=1270366
 interface PluginArray {
   readonly attribute unsigned long length;
 
   getter Plugin? item(unsigned long index);
   getter Plugin? namedItem(DOMString name);
 
   void refresh(optional boolean reloadDocuments = false);
 };
--- a/dom/xhr/XMLHttpRequestMainThread.cpp
+++ b/dom/xhr/XMLHttpRequestMainThread.cpp
@@ -1381,79 +1381,59 @@ XMLHttpRequestMainThread::InUploadPhase(
   return mState == State::opened;
 }
 
 NS_IMETHODIMP
 XMLHttpRequestMainThread::Open(const nsACString& aMethod, const nsACString& aUrl,
                                bool aAsync, const nsAString& aUsername,
                                const nsAString& aPassword, uint8_t optional_argc)
 {
-  Optional<bool> async;
-  if (!optional_argc) {
-    // No optional arguments were passed in. Default async to true.
-    async.Construct() = true;
-  } else {
-    async.Construct() = aAsync;
-  }
-  Optional<nsAString> username;
-  if (optional_argc > 1) {
-    username = &aUsername;
-  }
-  Optional<nsAString> password;
-  if (optional_argc > 2) {
-    password = &aPassword;
-  }
-  return Open(aMethod, aUrl, async, username, password);
+  return Open(aMethod, aUrl, optional_argc > 0 ? aAsync : true,
+              aUsername, aPassword);
 }
 
 // This case is hit when the async parameter is outright omitted, which
 // should set it to true (and the username and password to null).
 void
 XMLHttpRequestMainThread::Open(const nsACString& aMethod, const nsAString& aUrl,
                                ErrorResult& aRv)
 {
-  aRv = Open(aMethod, NS_ConvertUTF16toUTF8(aUrl), Optional<bool>(true),
-             Optional<nsAString>(), Optional<nsAString>());
+  Open(aMethod, aUrl, true, NullString(), NullString(), aRv);
 }
 
 // This case is hit when the async parameter is specified, even if the
 // JS value was "undefined" (which due to legacy reasons should be
 // treated as true, which is how it will already be passed in here).
 void
 XMLHttpRequestMainThread::Open(const nsACString& aMethod,
                                const nsAString& aUrl,
                                bool aAsync,
                                const nsAString& aUsername,
                                const nsAString& aPassword,
                                ErrorResult& aRv)
 {
-  Optional<nsAString> username;
-  username = &aUsername;
-  Optional<nsAString> password;
-  password = &aPassword;
-  aRv = Open(aMethod, NS_ConvertUTF16toUTF8(aUrl),
-             Optional<bool>(aAsync), username, password);
+  nsresult rv = Open(aMethod, NS_ConvertUTF16toUTF8(aUrl), aAsync, aUsername, aPassword);
+  if (NS_FAILED(rv)) {
+    aRv.Throw(rv);
+  }
 }
 
 nsresult
 XMLHttpRequestMainThread::Open(const nsACString& aMethod,
                                const nsACString& aUrl,
-                               const Optional<bool>& aAsync,
-                               const Optional<nsAString>& aUsername,
-                               const Optional<nsAString>& aPassword)
-{
-  bool async = aAsync.WasPassed() ? aAsync.Value() : true;
-
+                               bool aAsync,
+                               const nsAString& aUsername,
+                               const nsAString& aPassword) {
   // Gecko-specific
-  if (!async && !DontWarnAboutSyncXHR() && GetOwner() &&
+  if (!aAsync && !DontWarnAboutSyncXHR() && GetOwner() &&
       GetOwner()->GetExtantDoc()) {
     GetOwner()->GetExtantDoc()->WarnOnceAbout(nsIDocument::eSyncXMLHttpRequest);
   }
 
-  Telemetry::Accumulate(Telemetry::XMLHTTPREQUEST_ASYNC_OR_SYNC, async ? 0 : 1);
+  Telemetry::Accumulate(Telemetry::XMLHTTPREQUEST_ASYNC_OR_SYNC, aAsync ? 0 : 1);
 
   // Step 1
   nsCOMPtr<nsIDocument> responsibleDocument = GetDocumentIfCurrent();
   if (!responsibleDocument) {
     // This could be because we're no longer current or because we're in some
     // non-window context...
     nsresult rv = CheckInnerWindowCorrectness();
     if (NS_WARN_IF(NS_FAILED(rv))) {
@@ -1483,39 +1463,37 @@ XMLHttpRequestMainThread::Open(const nsA
       return NS_ERROR_DOM_SYNTAX_ERR;
     }
     return rv;
   }
   if (NS_WARN_IF(NS_FAILED(CheckInnerWindowCorrectness()))) {
     return NS_ERROR_DOM_INVALID_STATE_ERR;
   }
 
-  // Step 7 is already done above.
-  // Note that the username and password are already passed in as null by Open()
-  // if the async parameter is omitted, so there's no need check again here.
+  // Step 7
+  // This is already handled by the other Open() method, which passes
+  // username and password in as NullStrings.
 
   // Step 8
-  if (aAsync.WasPassed()) {
-    nsAutoCString host;
-    parsedURL->GetHost(host);
-    if (!host.IsEmpty()) {
-      nsAutoCString userpass;
-      if (aUsername.WasPassed()) {
-        CopyUTF16toUTF8(aUsername.Value(), userpass);
-      }
-      userpass.AppendLiteral(":");
-      if (aPassword.WasPassed()) {
-        AppendUTF16toUTF8(aPassword.Value(), userpass);
-      }
-      parsedURL->SetUserPass(userpass);
+  nsAutoCString host;
+  parsedURL->GetHost(host);
+  if (!host.IsEmpty()) {
+    nsAutoCString userpass;
+    if (!aUsername.IsVoid()) {
+      CopyUTF16toUTF8(aUsername, userpass);
     }
+    userpass.AppendLiteral(":");
+    if (!aPassword.IsVoid()) {
+      AppendUTF16toUTF8(aPassword, userpass);
+    }
+    parsedURL->SetUserPass(userpass);
   }
 
   // Step 9
-  if (!async && HasOrHasHadOwner() && (mTimeoutMilliseconds ||
+  if (!aAsync && HasOrHasHadOwner() && (mTimeoutMilliseconds ||
        mResponseType != XMLHttpRequestResponseType::_empty)) {
     if (mTimeoutMilliseconds) {
       LogMessage("TimeoutSyncXHRWarning", GetOwner());
     }
     if (mResponseType != XMLHttpRequestResponseType::_empty) {
       LogMessage("ResponseTypeSyncXHRWarning", GetOwner());
     }
     return NS_ERROR_DOM_INVALID_ACCESS_ERR;
@@ -1524,17 +1502,17 @@ XMLHttpRequestMainThread::Open(const nsA
   // Step 10
   CloseRequest();
 
   // Step 11
   // timeouts are handled without a flag
   mFlagSend = false;
   mRequestMethod.Assign(method);
   mRequestURL = parsedURL;
-  mFlagSynchronous = !async;
+  mFlagSynchronous = !aAsync;
   mAuthorRequestHeaders.Clear();
   ResetResponse();
 
   // Gecko-specific
   mFlagHadUploadListenersOnSend = false;
   mFlagAborted = false;
   mFlagTimedOut = false;
 
--- a/dom/xhr/XMLHttpRequestMainThread.h
+++ b/dom/xhr/XMLHttpRequestMainThread.h
@@ -250,19 +250,19 @@ public:
   virtual void
   Open(const nsACString& aMethod, const nsAString& aUrl, bool aAsync,
        const nsAString& aUsername, const nsAString& aPassword,
        ErrorResult& aRv) override;
 
   nsresult
   Open(const nsACString& aMethod,
        const nsACString& aUrl,
-       const Optional<bool>& aAsync,
-       const Optional<nsAString>& aUsername,
-       const Optional<nsAString>& aPassword);
+       bool aAsync,
+       const nsAString& aUsername,
+       const nsAString& aPassword);
 
   virtual void
   SetRequestHeader(const nsACString& aName, const nsACString& aValue,
                    ErrorResult& aRv) override
   {
     aRv = SetRequestHeader(aName, aValue);
   }
 
--- a/dom/xhr/XMLHttpRequestWorker.cpp
+++ b/dom/xhr/XMLHttpRequestWorker.cpp
@@ -1421,25 +1421,29 @@ OpenRunnable::MainThreadRunInternal()
   if (mTimeout) {
     rv = mProxy->mXHR->SetTimeout(mTimeout);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   MOZ_ASSERT(!mProxy->mInOpen);
   mProxy->mInOpen = true;
 
-  rv = mProxy->mXHR->Open(mMethod, NS_ConvertUTF16toUTF8(mURL),
-                          Optional<bool>(true), mUser, mPassword);
+  ErrorResult rv2;
+  mProxy->mXHR->Open(mMethod, mURL, true,
+                     mUser.WasPassed() ? mUser.Value() : NullString(),
+                     mPassword.WasPassed() ? mPassword.Value() : NullString(),
+                     rv2);
 
   MOZ_ASSERT(mProxy->mInOpen);
   mProxy->mInOpen = false;
 
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  ErrorResult rv2;
+  if (rv2.Failed()) {
+    return rv2.StealNSResult();
+  }
+
   mProxy->mXHR->SetResponseType(mResponseType, rv2);
   if (rv2.Failed()) {
     return rv2.StealNSResult();
   }
 
   return NS_OK;
 }
 
--- a/editor/libeditor/HTMLEditor.cpp
+++ b/editor/libeditor/HTMLEditor.cpp
@@ -38,16 +38,17 @@
 #include "nsIInlineSpellChecker.h"
 
 #include "mozilla/css/Loader.h"
 #include "nsIDOMStyleSheet.h"
 
 #include "nsIContent.h"
 #include "nsIContentIterator.h"
 #include "nsISupportsArray.h"
+#include "nsIMutableArray.h"
 #include "nsContentUtils.h"
 #include "nsIDocumentEncoder.h"
 #include "nsIPresShell.h"
 #include "nsPresContext.h"
 #include "nsFocusManager.h"
 #include "nsPIDOMWindow.h"
 
 // netwerk
@@ -3060,23 +3061,23 @@ HTMLEditor::GetURLForStyleSheet(StyleShe
   if (foundIndex == -1)
     return;
 
   // Found it in the list!
   aURL = mStyleSheetURLs[foundIndex];
 }
 
 NS_IMETHODIMP
-HTMLEditor::GetEmbeddedObjects(nsISupportsArray** aNodeList)
+HTMLEditor::GetEmbeddedObjects(nsIArray** aNodeList)
 {
   NS_ENSURE_TRUE(aNodeList, NS_ERROR_NULL_POINTER);
 
-  nsresult rv = NS_NewISupportsArray(aNodeList);
+  nsresult rv;
+  nsCOMPtr<nsIMutableArray> nodes = do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
-  NS_ENSURE_TRUE(*aNodeList, NS_ERROR_NULL_POINTER);
 
   nsCOMPtr<nsIContentIterator> iter =
       do_CreateInstance("@mozilla.org/content/post-content-iterator;1", &rv);
   NS_ENSURE_TRUE(iter, NS_ERROR_NULL_POINTER);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIDocument> doc = GetDocument();
   NS_ENSURE_TRUE(doc, NS_ERROR_UNEXPECTED);
@@ -3091,22 +3092,23 @@ HTMLEditor::GetEmbeddedObjects(nsISuppor
 
       // See if it's an image or an embed and also include all links.
       // Let mail decide which link to send or not
       if (element->IsAnyOfHTMLElements(nsGkAtoms::img, nsGkAtoms::embed,
                                        nsGkAtoms::a) ||
           (element->IsHTMLElement(nsGkAtoms::body) &&
            element->HasAttr(kNameSpaceID_None, nsGkAtoms::background))) {
         nsCOMPtr<nsIDOMNode> domNode = do_QueryInterface(node);
-        (*aNodeList)->AppendElement(domNode);
-      }
-    }
-    iter->Next();
-  }
-
+        nodes->AppendElement(domNode, false);
+       }
+     }
+     iter->Next();
+   }
+
+  nodes.forget(aNodeList);
   return rv;
 }
 
 NS_IMETHODIMP
 HTMLEditor::DeleteSelectionImpl(EDirection aAction,
                                 EStripWrappers aStripWrappers)
 {
   MOZ_ASSERT(aStripWrappers == eStrip || aStripWrappers == eNoStrip);
--- a/editor/libeditor/TextEditor.cpp
+++ b/editor/libeditor/TextEditor.cpp
@@ -1530,19 +1530,23 @@ TextEditor::StripCites()
     rv = SelectAll();
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   return InsertText(stripped);
 }
 
 NS_IMETHODIMP
-TextEditor::GetEmbeddedObjects(nsISupportsArray** aNodeList)
-{
-  *aNodeList = 0;
+TextEditor::GetEmbeddedObjects(nsIArray** aNodeList)
+ {
+  if (NS_WARN_IF(!aNodeList)) {
+    return NS_ERROR_INVALID_ARG;
+  }
+
+  *aNodeList = nullptr;
   return NS_OK;
 }
 
 /**
  * All editor operations which alter the doc should be prefaced
  * with a call to StartOperation, naming the action and direction.
  */
 NS_IMETHODIMP
--- a/editor/nsIEditorMailSupport.idl
+++ b/editor/nsIEditorMailSupport.idl
@@ -1,16 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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 nsISupportsArray;
+interface nsIArray;
 interface nsIDOMNode;
 
 [scriptable, uuid(fdf23301-4a94-11d3-9ce4-9960496c41bc)]
 
 interface nsIEditorMailSupport : nsISupports
 {
   /** Paste the text in the OS clipboard at the cursor position,
     * as a quotation (whose representation is dependant on the editor type),
@@ -71,11 +71,11 @@ interface nsIEditorMailSupport : nsISupp
    * Strip any citations in the selected part of the document.
    */
   void stripCites();
 
 
   /**
    * Get a list of IMG and OBJECT tags in the current document.
    */
-  nsISupportsArray getEmbeddedObjects();
+  nsIArray getEmbeddedObjects();
 };
 
--- a/gfx/2d/DataSurfaceHelpers.cpp
+++ b/gfx/2d/DataSurfaceHelpers.cpp
@@ -260,31 +260,53 @@ ClearDataSourceSurface(DataSourceSurface
   aSurface->Unmap();
 }
 
 size_t
 BufferSizeFromStrideAndHeight(int32_t aStride,
                               int32_t aHeight,
                               int32_t aExtraBytes)
 {
-  if (MOZ_UNLIKELY(aHeight <= 0)) {
+  if (MOZ_UNLIKELY(aHeight <= 0) || MOZ_UNLIKELY(aStride <= 0)) {
     return 0;
   }
 
   // We limit the length returned to values that can be represented by int32_t
   // because we don't want to allocate buffers any bigger than that. This
   // allows for a buffer size of over 2 GiB which is already rediculously
   // large and will make the process janky. (Note the choice of the signed type
   // is deliberate because we specifically don't want the returned value to
   // overflow if someone stores the buffer length in an int32_t variable.)
 
   CheckedInt32 requiredBytes =
     CheckedInt32(aStride) * CheckedInt32(aHeight) + CheckedInt32(aExtraBytes);
   if (MOZ_UNLIKELY(!requiredBytes.isValid())) {
-    gfxWarning() << "Buffer size too big; returning zero";
+    gfxWarning() << "Buffer size too big; returning zero " << aStride << ", " << aHeight << ", " << aExtraBytes;
+    return 0;
+  }
+  return requiredBytes.value();
+}
+
+size_t
+BufferSizeFromDimensions(int32_t aWidth,
+                         int32_t aHeight,
+                         int32_t aDepth,
+                         int32_t aExtraBytes)
+{
+  if (MOZ_UNLIKELY(aHeight <= 0) ||
+      MOZ_UNLIKELY(aWidth <= 0) ||
+      MOZ_UNLIKELY(aDepth <= 0)) {
+    return 0;
+  }
+
+  // Similar to BufferSizeFromStrideAndHeight, but with an extra parameter.
+
+  CheckedInt32 requiredBytes = CheckedInt32(aWidth) * CheckedInt32(aHeight) * CheckedInt32(aDepth) + CheckedInt32(aExtraBytes);
+  if (MOZ_UNLIKELY(!requiredBytes.isValid())) {
+    gfxWarning() << "Buffer size too big; returning zero " << aWidth << ", " << aHeight << ", " << aDepth << ", " << aExtraBytes;
     return 0;
   }
   return requiredBytes.value();
 }
 
 /**
  * aSrcRect: Rect relative to the aSrc surface
  * aDestPoint: Point inside aDest surface
--- a/gfx/2d/DataSurfaceHelpers.h
+++ b/gfx/2d/DataSurfaceHelpers.h
@@ -88,16 +88,32 @@ ClearDataSourceSurface(DataSourceSurface
  * @return The result of the multiplication if it is acceptable, or else zero.
  */
 size_t
 BufferSizeFromStrideAndHeight(int32_t aStride,
                               int32_t aHeight,
                               int32_t aExtraBytes = 0);
 
 /**
+ * Multiplies aWidth, aHeight, aDepth and makes sure the result is limited to
+ * something sane. To keep things consistent, this should always be used
+ * wherever we allocate a buffer based on surface dimensions.
+ *
+ * @param aExtra Optional argument to specify an additional number of trailing
+ *   bytes (useful for creating intermediate surfaces for filters, for
+ *   example).
+ *
+ * @return The result of the multiplication if it is acceptable, or else zero.
+ */
+size_t
+BufferSizeFromDimensions(int32_t aWidth,
+                         int32_t aHeight,
+                         int32_t aDepth,
+                         int32_t aExtraBytes = 0);
+/**
  * Copy aSrcRect from aSrc to aDest starting at aDestPoint.
  * @returns false if the copy is not successful or the aSrc's size is empty.
  */
 bool
 CopyRect(DataSourceSurface* aSrc, DataSourceSurface* aDest,
          IntRect aSrcRect, IntPoint aDestPoint);
 
 /**
--- a/gfx/2d/Factory.cpp
+++ b/gfx/2d/Factory.cpp
@@ -731,16 +731,20 @@ Factory::CreateDrawTargetSkiaWithGrConte
 void
 Factory::PurgeAllCaches()
 {
 }
 
 already_AddRefed<DrawTarget>
 Factory::CreateDrawTargetForCairoSurface(cairo_surface_t* aSurface, const IntSize& aSize, SurfaceFormat* aFormat)
 {
+  if (!AllowedSurfaceSize(aSize)) {
+    gfxWarning() << "Allowing surface with invalid size (Cairo) " << aSize;
+  }
+
   RefPtr<DrawTarget> retVal;
 
 #ifdef USE_CAIRO
   RefPtr<DrawTargetCairo> newTarget = new DrawTargetCairo();
 
   if (newTarget->Init(aSurface, aSize, aFormat)) {
     retVal = newTarget;
   }
@@ -766,16 +770,21 @@ Factory::CreateSourceSurfaceForCairoSurf
   return nullptr;
 #endif
 }
 
 #ifdef XP_DARWIN
 already_AddRefed<DrawTarget>
 Factory::CreateDrawTargetForCairoCGContext(CGContextRef cg, const IntSize& aSize)
 {
+  if (!AllowedSurfaceSize(aSize)) {
+    gfxCriticalError(LoggerOptionsBasedOnSize(aSize)) << "Failed to allocate a surface due to invalid size (CG) " << aSize;
+    return nullptr;
+  }
+
   RefPtr<DrawTarget> retVal;
 
   RefPtr<DrawTargetCG> newTarget = new DrawTargetCG();
 
   if (newTarget->Init(cg, aSize)) {
     retVal = newTarget;
   }
 
@@ -795,17 +804,17 @@ Factory::CreateCGGlyphRenderingOptions(c
 already_AddRefed<DataSourceSurface>
 Factory::CreateWrappingDataSourceSurface(uint8_t *aData,
                                          int32_t aStride,
                                          const IntSize &aSize,
                                          SurfaceFormat aFormat,
                                          SourceSurfaceDeallocator aDeallocator /* = nullptr */,
                                          void* aClosure /* = nullptr */)
 {
-  if (aSize.width <= 0 || aSize.height <= 0) {
+  if (!AllowedSurfaceSize(aSize)) {
     return nullptr;
   }
   if (!aDeallocator && aClosure) {
     return nullptr;
   }
 
   MOZ_ASSERT(aData);
 
@@ -839,17 +848,18 @@ Factory::CreateDataSourceSurface(const I
 }
 
 already_AddRefed<DataSourceSurface>
 Factory::CreateDataSourceSurfaceWithStride(const IntSize &aSize,
                                            SurfaceFormat aFormat,
                                            int32_t aStride,
                                            bool aZero)
 {
-  if (aStride < aSize.width * BytesPerPixel(aFormat)) {
+  if (!AllowedSurfaceSize(aSize) ||
+      aStride < aSize.width * BytesPerPixel(aFormat)) {
     gfxCriticalError(LoggerOptionsBasedOnSize(aSize)) << "CreateDataSourceSurfaceWithStride failed with bad stride " << aStride << ", " << aSize << ", " << aFormat;
     return nullptr;
   }
 
   // Skia doesn't support RGBX, so memset RGBX to 0xFF
   bool clearSurface = aZero || aFormat == SurfaceFormat::B8G8R8X8;
   uint8_t clearValue = aFormat == SurfaceFormat::B8G8R8X8 ? 0xFF : 0;
 
--- a/gfx/2d/ImageScaling.cpp
+++ b/gfx/2d/ImageScaling.cpp
@@ -60,30 +60,30 @@ ImageHalfScaler::ScaleForSize(const IntS
     horizontalDownscales++;
     scaleSize.width /= 2;
   }
 
   if (scaleSize == mOrigSize) {
     return;
   }
 
+  delete [] mDataStorage;
+
   IntSize internalSurfSize;
-
   internalSurfSize.width = max(scaleSize.width, mOrigSize.width / 2);
   internalSurfSize.height = max(scaleSize.height, mOrigSize.height / 2);
 
-  mStride = internalSurfSize.width * 4;
-  if (mStride % 16) {
-    mStride += 16 - (mStride % 16);
+  size_t bufLen = 0;
+  mStride = GetAlignedStride<16>(internalSurfSize.width, 4);
+  if (mStride > 0) {
+    // Allocate 15 bytes extra to make sure we can get 16 byte alignment. We
+    // should add tools for this, see bug 751696.
+    bufLen = BufferSizeFromStrideAndHeight(mStride, internalSurfSize.height, 15);
   }
 
-  delete [] mDataStorage;
-  // Allocate 15 bytes extra to make sure we can get 16 byte alignment. We
-  // should add tools for this, see bug 751696.
-  size_t bufLen = BufferSizeFromStrideAndHeight(mStride, internalSurfSize.height, 15);
   if (bufLen == 0) {
     mSize.SizeTo(0, 0);
     mDataStorage = nullptr;
     return;
   }
   mDataStorage = new uint8_t[bufLen];
 
   if (uintptr_t(mDataStorage) % 16) {
--- a/gfx/2d/SourceSurfaceRawData.h
+++ b/gfx/2d/SourceSurfaceRawData.h
@@ -75,17 +75,18 @@ public:
     mMapCount--;
     MOZ_ASSERT(mMapCount >= 0);
   }
 
 private:
   friend class Factory;
 
   // If we have a custom deallocator, the |aData| will be released using the
-  // custom deallocator and |aClosure| in dtor.
+  // custom deallocator and |aClosure| in dtor.  The assumption is that the
+  // caller will check for valid size and stride before making this call.
   void InitWrappingData(unsigned char *aData,
                         const IntSize &aSize,
                         int32_t aStride,
                         SurfaceFormat aFormat,
                         Factory::SourceSurfaceDeallocator aDeallocator,
                         void* aClosure);
 
   uint8_t *mRawData;
--- a/gfx/2d/moz.build
+++ b/gfx/2d/moz.build
@@ -194,17 +194,17 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'coco
     ]
     SOURCES += [
         'MacIOSurface.cpp',
         'QuartzSupport.mm',
     ]
 
 if CONFIG['CPU_ARCH'] == 'arm' and CONFIG['BUILD_ARM_NEON']:
     SOURCES += ['BlurNEON.cpp']
-    SOURCES['BlurNEON.cpp'].flags += ['-mfpu=neon']
+    SOURCES['BlurNEON.cpp'].flags += CONFIG['NEON_FLAGS']
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
 for var in ('USE_CAIRO', 'MOZ2D_HAS_MOZ_CAIRO'):
     DEFINES[var] = True
 
--- a/gfx/cairo/libpixman/src/moz.build
+++ b/gfx/cairo/libpixman/src/moz.build
@@ -132,17 +132,17 @@ if use_vmx:
 
 if use_arm_simd_gcc:
     DEFINES['USE_ARM_SIMD'] = True
     SOURCES += ['pixman-arm-simd.c']
 
 if use_arm_neon_gcc:
     DEFINES['USE_ARM_NEON'] = True
     SOURCES += ['pixman-arm-neon.c']
-    SOURCES['pixman-arm-neon.c'].flags += ['-mfpu=neon']
+    SOURCES['pixman-arm-neon.c'].flags += CONFIG['NEON_FLAGS']
 
 # Suppress warnings in third-party code.
 if CONFIG['GNU_CC'] or CONFIG['CLANG_CL']:
     CFLAGS += [
         '-Wno-address',
         '-Wno-missing-field-initializers',
         '-Wno-sign-compare',
         '-Wno-unused',                      # too many unused warnings; ignore
--- a/gfx/layers/TextureDIB.cpp
+++ b/gfx/layers/TextureDIB.cpp
@@ -1,15 +1,16 @@
 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * 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 "TextureDIB.h"
 #include "gfx2DGlue.h"
+#include "mozilla/gfx/DataSurfaceHelpers.h" // For BufferSizeFromDimensions
 #include "mozilla/layers/ISurfaceAllocator.h"
 #include "mozilla/ipc/ProtocolUtils.h"
 
 namespace mozilla {
 
 using namespace gfx;
 
 namespace layers {
@@ -428,17 +429,17 @@ DIBTextureHost::UpdatedInternal(const ns
       gfxWarning() << "Bad Cairo surface internal update " << mSurface->CairoStatus();
       mTextureSource = nullptr;
       return;
   }
   RefPtr<gfxImageSurface> imgSurf = mSurface->GetAsImageSurface();
 
   RefPtr<DataSourceSurface> surf = Factory::CreateWrappingDataSourceSurface(imgSurf->Data(), imgSurf->Stride(), mSize, mFormat);
 
-  if (!mTextureSource->Update(surf, const_cast<nsIntRegion*>(aRegion))) {
+  if (!surf || !mTextureSource->Update(surf, const_cast<nsIntRegion*>(aRegion))) {
     mTextureSource = nullptr;
   }
 
   ReadUnlock();
 }
 
 TextureHostFileMapping::TextureHostFileMapping(TextureFlags aFlags,
                                                const SurfaceDescriptorFileMapping& aDescriptor)
@@ -468,24 +469,30 @@ TextureHostFileMapping::UpdatedInternal(
     // attached to a layer.
     return;
   }
 
   if (!mTextureSource) {
     mTextureSource = mCompositor->CreateDataTextureSource(mFlags);
   }
 
-  uint8_t* data = (uint8_t*)::MapViewOfFile(mFileMapping, FILE_MAP_READ, 0, 0, mSize.width * mSize.height * BytesPerPixel(mFormat));
+  uint8_t* data = nullptr;
+  int32_t totalBytes = BufferSizeFromDimensions(mSize.width, mSize.height, BytesPerPixel(mFormat));
+  if (totalBytes > 0) {
+    data = (uint8_t*)::MapViewOfFile(mFileMapping, FILE_MAP_READ, 0, 0, totalBytes);
+  }
 
   if (data) {
     RefPtr<DataSourceSurface> surf = Factory::CreateWrappingDataSourceSurface(data, mSize.width * BytesPerPixel(mFormat), mSize, mFormat);
-
-    surf->AddUserData(&kFileMappingKey, data, UnmapFileData);
-
-    if (!mTextureSource->Update(surf, const_cast<nsIntRegion*>(aRegion))) {
+    if (surf) {
+        surf->AddUserData(&kFileMappingKey, data, UnmapFileData);
+        if (!mTextureSource->Update(surf, const_cast<nsIntRegion*>(aRegion))) {
+          mTextureSource = nullptr;
+        }
+    } else {
       mTextureSource = nullptr;
     }
   } else {
     mTextureSource = nullptr;
   }
 
   ReadUnlock();
 }
--- a/gfx/layers/basic/BasicPaintedLayer.cpp
+++ b/gfx/layers/basic/BasicPaintedLayer.cpp
@@ -132,17 +132,17 @@ BasicPaintedLayer::PaintThebes(gfxContex
 void
 BasicPaintedLayer::Validate(LayerManager::DrawPaintedLayerCallback aCallback,
                            void* aCallbackData,
                            ReadbackProcessor* aReadback)
 {
   if (!mContentClient) {
     // This client will have a null Forwarder, which means it will not have
     // a ContentHost on the other side.
-    mContentClient = new ContentClientBasic();
+    mContentClient = new ContentClientBasic(mBackend);
   }
 
   if (!BasicManager()->IsRetained()) {
     return;
   }
 
   nsTArray<ReadbackProcessor::Update> readbackUpdates;
   if (aReadback && UsedForReadback()) {
@@ -224,14 +224,23 @@ BasicPaintedLayer::Validate(LayerManager
     }
   }
 }
 
 already_AddRefed<PaintedLayer>
 BasicLayerManager::CreatePaintedLayer()
 {
   NS_ASSERTION(InConstruction(), "Only allowed in construction phase");
-  RefPtr<PaintedLayer> layer = new BasicPaintedLayer(this);
+
+  BackendType backend = gfxPlatform::GetPlatform()->GetDefaultContentBackend();
+
+  if (mDefaultTarget) {
+    backend = mDefaultTarget->GetDrawTarget()->GetBackendType();
+  } else if (mType == BLM_WIDGET) {
+    backend = gfxPlatform::GetPlatform()->GetContentBackendFor(LayersBackend::LAYERS_BASIC);
+  }
+
+  RefPtr<PaintedLayer> layer = new BasicPaintedLayer(this, backend);
   return layer.forget();
 }
 
 } // namespace layers
 } // namespace mozilla
--- a/gfx/layers/basic/BasicPaintedLayer.h
+++ b/gfx/layers/basic/BasicPaintedLayer.h
@@ -25,19 +25,20 @@ namespace layers {
 
 class ReadbackProcessor;
 
 class BasicPaintedLayer : public PaintedLayer, public BasicImplData {
 public:
   typedef RotatedContentBuffer::PaintState PaintState;
   typedef RotatedContentBuffer::ContentType ContentType;
 
-  explicit BasicPaintedLayer(BasicLayerManager* aLayerManager) :
+  explicit BasicPaintedLayer(BasicLayerManager* aLayerManager, gfx::BackendType aBackend) :
     PaintedLayer(aLayerManager, static_cast<BasicImplData*>(this)),
     mContentClient(nullptr)
+    , mBackend(aBackend)
   {
     MOZ_COUNT_CTOR(BasicPaintedLayer);
   }
 
 protected:
   virtual ~BasicPaintedLayer()
   {
     MOZ_COUNT_DTOR(BasicPaintedLayer);
@@ -118,14 +119,15 @@ protected:
     // here (OR doesn't automatically simplify to the simplest possible
     // representation of a region.)
     nsIntRegion tmp;
     tmp.Or(mVisibleRegion.ToUnknownRegion(), aExtendedRegionToDraw);
     mValidRegion.Or(mValidRegion, tmp);
   }
 
   RefPtr<ContentClientBasic> mContentClient;
+  gfx::BackendType mBackend;
 };
 
 } // namespace layers
 } // namespace mozilla
 
 #endif
--- a/gfx/layers/basic/GrallocTextureHostBasic.cpp
+++ b/gfx/layers/basic/GrallocTextureHostBasic.cpp
@@ -135,19 +135,23 @@ GrallocTextureHostBasic::Lock()
       return false;
     }
     surf = gfx::Factory::CreateWrappingDataSourceSurface(
              mMappedBuffer,
              graphicBuffer->getStride() * gfx::BytesPerPixel(mFormat),
              mCropSize,
              mFormat);
   }
-  mTextureSource = mCompositor->CreateDataTextureSource(mFlags);
-  mTextureSource->Update(surf, nullptr);
-  return true;
+  if (surf) {
+    mTextureSource = mCompositor->CreateDataTextureSource(mFlags);
+    mTextureSource->Update(surf, nullptr);
+    return true;
+  }
+  mMappedBuffer = nullptr;
+  return false;
 }
 
 bool
 GrallocTextureHostBasic::IsValid() const
 {
   android::GraphicBuffer* graphicBuffer = GetGraphicBufferFromDesc(mGrallocHandle).get();
   return graphicBuffer != nullptr;
 }
--- a/gfx/layers/client/ClientLayerManager.cpp
+++ b/gfx/layers/client/ClientLayerManager.cpp
@@ -267,16 +267,26 @@ ClientLayerManager::BeginTransaction()
 bool
 ClientLayerManager::EndTransactionInternal(DrawPaintedLayerCallback aCallback,
                                            void* aCallbackData,
                                            EndTransactionFlags)
 {
   PROFILER_LABEL("ClientLayerManager", "EndTransactionInternal",
     js::ProfileEntry::Category::GRAPHICS);
 
+  if (!mForwarder || !mForwarder->IPCOpen()) {
+    gfxCriticalError() << "LayerManager::EndTransaction while IPC is dead.";
+    // Pointless to try to render since the content cannot be sent to the
+    // compositor. We should not get here in the first place but I suspect
+    // This is happening during shutdown, tab-switch or some other scenario
+    // where we already started tearing the resources down but something
+    // triggered painting anyway.
+    return false;
+  }
+
 #ifdef MOZ_LAYERS_HAVE_LOG
   MOZ_LAYERS_LOG(("  ----- (beginning paint)"));
   Log();
 #endif
   profiler_tracing("Paint", "Rasterize", TRACING_INTERVAL_START);
 
   NS_ASSERTION(InConstruction(), "Should be in construction phase");
   mPhase = PHASE_DRAWING;
--- a/gfx/layers/client/ContentClient.cpp
+++ b/gfx/layers/client/ContentClient.cpp
@@ -109,34 +109,36 @@ ContentClient::PrintInfo(std::stringstre
     pfx += "  ";
 
     Dump(aStream, pfx.get(), false);
   }
 }
 
 // We pass a null pointer for the ContentClient Forwarder argument, which means
 // this client will not have a ContentHost on the other side.
-ContentClientBasic::ContentClientBasic()
+ContentClientBasic::ContentClientBasic(gfx::BackendType aBackend)
   : ContentClient(nullptr)
   , RotatedContentBuffer(ContainsVisibleBounds)
+  , mBackend(aBackend)
 {}
 
 void
 ContentClientBasic::CreateBuffer(ContentType aType,
                                  const IntRect& aRect,
                                  uint32_t aFlags,
                                  RefPtr<gfx::DrawTarget>* aBlackDT,
                                  RefPtr<gfx::DrawTarget>* aWhiteDT)
 {
   MOZ_ASSERT(!(aFlags & BUFFER_COMPONENT_ALPHA));
   if (aFlags & BUFFER_COMPONENT_ALPHA) {
     gfxDevCrash(LogReason::AlphaWithBasicClient) << "Asking basic content client for component alpha";
   }
 
-  *aBlackDT = gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget(
+  *aBlackDT = gfxPlatform::GetPlatform()->CreateDrawTargetForBackend(
+    mBackend,
     IntSize(aRect.width, aRect.height),
     gfxPlatform::GetPlatform()->Optimal2DFormatForContent(aType));
 }
 
 void
 ContentClientRemoteBuffer::DestroyBuffers()
 {
   if (!mTextureClient) {
--- a/gfx/layers/client/ContentClient.h
+++ b/gfx/layers/client/ContentClient.h
@@ -121,17 +121,17 @@ public:
                        bool aDidSelfCopy) = 0;
 };
 
 // thin wrapper around RotatedContentBuffer, for on-mtc
 class ContentClientBasic final : public ContentClient
                                , protected RotatedContentBuffer
 {
 public:
-  ContentClientBasic();
+  explicit ContentClientBasic(gfx::BackendType aBackend);
 
   typedef RotatedContentBuffer::PaintState PaintState;
   typedef RotatedContentBuffer::ContentType ContentType;
 
   virtual void Clear() override { RotatedContentBuffer::Clear(); }
   virtual PaintState BeginPaintBuffer(PaintedLayer* aLayer,
                                       uint32_t aFlags) override
   {
@@ -160,16 +160,19 @@ public:
 
   virtual void CreateBuffer(ContentType aType, const gfx::IntRect& aRect, uint32_t aFlags,
                             RefPtr<gfx::DrawTarget>* aBlackDT, RefPtr<gfx::DrawTarget>* aWhiteDT) override;
 
   virtual TextureInfo GetTextureInfo() const override
   {
     MOZ_CRASH("GFX: Should not be called on non-remote ContentClient");
   }
+
+private:
+  gfx::BackendType mBackend;
 };
 
 /**
  * A ContentClientRemote backed by a RotatedContentBuffer.
  *
  * When using a ContentClientRemote, SurfaceDescriptors are created on
  * the rendering side and destroyed on the compositing side. They are only
  * passed from one side to the other when the TextureClient/Hosts are created.
--- a/gfx/layers/composite/CanvasLayerComposite.cpp
+++ b/gfx/layers/composite/CanvasLayerComposite.cpp
@@ -84,17 +84,19 @@ CanvasLayerComposite::RenderLayer(const 
     return;
   }
 
   mCompositor->MakeCurrent();
 
 #ifdef MOZ_DUMP_PAINTING
   if (gfxEnv::DumpCompositorTextures()) {
     RefPtr<gfx::DataSourceSurface> surf = mCompositableHost->GetAsSurface();
-    WriteSnapshotToDumpFile(this, surf);
+    if (surf) {
+      WriteSnapshotToDumpFile(this, surf);
+    }
   }
 #endif
 
   RenderWithAllMasks(this, mCompositor, aClipRect,
                      [&](EffectChain& effectChain, const IntRect& clipRect) {
     mCompositableHost->Composite(this, effectChain,
                           GetEffectiveOpacity(),
                           GetEffectiveTransform(),
--- a/gfx/layers/composite/ImageLayerComposite.cpp
+++ b/gfx/layers/composite/ImageLayerComposite.cpp
@@ -94,17 +94,19 @@ ImageLayerComposite::RenderLayer(const I
 {
   if (!mImageHost || !mImageHost->IsAttached()) {
     return;
   }
 
 #ifdef MOZ_DUMP_PAINTING
   if (gfxEnv::DumpCompositorTextures()) {
     RefPtr<gfx::DataSourceSurface> surf = mImageHost->GetAsSurface();
-    WriteSnapshotToDumpFile(this, surf);
+    if (surf) {
+      WriteSnapshotToDumpFile(this, surf);
+    }
   }
 #endif
 
   mCompositor->MakeCurrent();
 
   RenderWithAllMasks(this, mCompositor, aClipRect,
                      [&](EffectChain& effectChain, const IntRect& clipRect) {
     mImageHost->SetCompositor(mCompositor);
--- a/gfx/skia/generate_mozbuild.py
+++ b/gfx/skia/generate_mozbuild.py
@@ -321,17 +321,17 @@ def write_cflags(f, values, subsearch, c
   val_list = uniq(sorted(values, key=lambda x: x.lower()))
 
   if len(val_list) == 0:
     return
 
   for val in val_list:
     if val.find(subsearch) > 0:
       write_indent(indent)
-      f.write("SOURCES[\'" + val + "\'].flags += [\'" + cflag + "\']\n")
+      f.write("SOURCES[\'" + val + "\'].flags += " + cflag + "\n")
 
 def write_sources(f, values, indent):
 
   # Unfortunately for now the gpu and pathops directories are
   # non-unifiable. Keep track of this and fix it.
   unified_blacklist = [
     '_SSE',
     '_SSSE',
@@ -429,17 +429,17 @@ def write_mozbuild(sources):
   f.write("if CONFIG['INTEL_ARCHITECTURE']:\n")
   write_sources(f, sources['intel'], 4)
 
   f.write("elif CONFIG['CPU_ARCH'] == 'arm' and CONFIG['GNU_CC']:\n")
   write_sources(f, sources['arm'], 4)
 
   f.write("    if CONFIG['BUILD_ARM_NEON']:\n")
   write_list(f, 'SOURCES', sources['neon'], 8)
-  write_cflags(f, sources['neon'], 'neon', '-mfpu=neon', 8)
+  write_cflags(f, sources['neon'], 'neon', "CONFIG['NEON_FLAGS']", 8)
 
   f.write("else:\n")
   write_sources(f, sources['none'], 4)
 
   f.write(footer)
 
   f.close()
 
--- a/gfx/skia/moz.build
+++ b/gfx/skia/moz.build
@@ -531,21 +531,21 @@ elif CONFIG['CPU_ARCH'] == 'arm' and CON
     if CONFIG['BUILD_ARM_NEON']:
         SOURCES += [
             'skia/src/opts/SkBitmapProcState_arm_neon.cpp',
             'skia/src/opts/SkBitmapProcState_matrixProcs_neon.cpp',
             'skia/src/opts/SkBlitMask_opts_arm_neon.cpp',
             'skia/src/opts/SkBlitRow_opts_arm_neon.cpp',
             'skia/src/opts/SkOpts_neon.cpp',
         ]
-        SOURCES['skia/src/opts/SkBitmapProcState_arm_neon.cpp'].flags += ['-mfpu=neon']
-        SOURCES['skia/src/opts/SkBitmapProcState_matrixProcs_neon.cpp'].flags += ['-mfpu=neon']
-        SOURCES['skia/src/opts/SkBlitMask_opts_arm_neon.cpp'].flags += ['-mfpu=neon']
-        SOURCES['skia/src/opts/SkBlitRow_opts_arm_neon.cpp'].flags += ['-mfpu=neon']
-        SOURCES['skia/src/opts/SkOpts_neon.cpp'].flags += ['-mfpu=neon']
+        SOURCES['skia/src/opts/SkBitmapProcState_arm_neon.cpp'].flags += CONFIG['NEON_FLAGS']
+        SOURCES['skia/src/opts/SkBitmapProcState_matrixProcs_neon.cpp'].flags += CONFIG['NEON_FLAGS']
+        SOURCES['skia/src/opts/SkBlitMask_opts_arm_neon.cpp'].flags += CONFIG['NEON_FLAGS']
+        SOURCES['skia/src/opts/SkBlitRow_opts_arm_neon.cpp'].flags += CONFIG['NEON_FLAGS']
+        SOURCES['skia/src/opts/SkOpts_neon.cpp'].flags += CONFIG['NEON_FLAGS']
 else:
     UNIFIED_SOURCES += [
         'skia/src/opts/SkBitmapProcState_opts_none.cpp',
         'skia/src/opts/SkBlitMask_opts_none.cpp',
         'skia/src/opts/SkBlitRow_opts_none.cpp',
     ]
 
 
--- a/gfx/thebes/gfxAndroidPlatform.cpp
+++ b/gfx/thebes/gfxAndroidPlatform.cpp
@@ -118,16 +118,20 @@ gfxAndroidPlatform::~gfxAndroidPlatform(
     FT_Done_Library(gPlatformFTLibrary);
     gPlatformFTLibrary = nullptr;
 }
 
 already_AddRefed<gfxASurface>
 gfxAndroidPlatform::CreateOffscreenSurface(const IntSize& aSize,
                                            gfxImageFormat aFormat)
 {
+    if (!Factory::AllowedSurfaceSize(aSize)) {
+        return nullptr;
+    }
+
     RefPtr<gfxASurface> newSurface;
     newSurface = new gfxImageSurface(aSize, aFormat);
 
     return newSurface.forget();
 }
 
 static bool
 IsJapaneseLocale()
--- a/gfx/thebes/gfxBlur.cpp
+++ b/gfx/thebes/gfxBlur.cpp
@@ -486,22 +486,21 @@ CreateBlurMask(const IntSize& aMinSize,
 
   MOZ_ASSERT(aSliceBorder.LeftRight() <= expandedMinRect.width);
   MOZ_ASSERT(aSliceBorder.TopBottom() <= expandedMinRect.height);
 
   return result.forget();
 }
 
 static already_AddRefed<SourceSurface>
-CreateBoxShadow(SourceSurface* aBlurMask, const Color& aShadowColor)
+CreateBoxShadow(DrawTarget& aDestDT, SourceSurface* aBlurMask, const Color& aShadowColor)
 {
   IntSize blurredSize = aBlurMask->GetSize();
-  gfxPlatform* platform = gfxPlatform::GetPlatform();
   RefPtr<DrawTarget> boxShadowDT =
-    platform->CreateOffscreenContentDrawTarget(blurredSize, SurfaceFormat::B8G8R8A8);
+    aDestDT.CreateSimilarDrawTarget(blurredSize, SurfaceFormat::B8G8R8A8);
 
   if (!boxShadowDT) {
     return nullptr;
   }
 
   ColorPattern shadowColor(ToDeviceColor(aShadowColor));
   boxShadowDT->MaskSurface(shadowColor, aBlurMask, Point(0, 0));
   return boxShadowDT->Snapshot();
@@ -548,17 +547,17 @@ GetBlur(gfxContext* aDestinationCtx,
   RefPtr<SourceSurface> blurMask =
     CreateBlurMask(minSize, aCornerRadii, aBlurRadius, aExtendDestBy, aSlice,
                    destDT);
 
   if (!blurMask) {
     return nullptr;
   }
 
-  RefPtr<SourceSurface> boxShadow = CreateBoxShadow(blurMask, aShadowColor);
+  RefPtr<SourceSurface> boxShadow = CreateBoxShadow(destDT, blurMask, aShadowColor);
   if (!boxShadow) {
     return nullptr;
   }
 
   if (useDestRect) {
     // Since we're just going to paint the actual rect to the destination
     aSlice.SizeTo(0, 0, 0, 0);
   } else {
@@ -908,17 +907,17 @@ gfxAlphaBoxBlur::GetInsetBlur(const mozi
   // Create the A8 mask
   IntPoint topLeft;
   RefPtr<SourceSurface> minMask = DoBlur(minDrawTarget, &topLeft);
   if (!minMask) {
     return nullptr;
   }
 
   // Fill in with the color we actually wanted
-  RefPtr<SourceSurface> minInsetBlur = CreateBoxShadow(minMask, aShadowColor);
+  RefPtr<SourceSurface> minInsetBlur = CreateBoxShadow(*aDestDrawTarget, minMask, aShadowColor);
   if (!minInsetBlur) {
     return nullptr;
   }
 
   if (!aIsDestRect) {
     CacheInsetBlur(outerSize, whitespaceSize,
                    aBlurRadius, &aInnerClipRadii,
                    aShadowColor, aHasBorderRadius,
--- a/gfx/thebes/gfxPlatformGtk.cpp
+++ b/gfx/thebes/gfxPlatformGtk.cpp
@@ -137,16 +137,20 @@ gfxPlatformGtk::FlushContentDrawing()
         XFlush(DefaultXDisplay());
     }
 }
 
 already_AddRefed<gfxASurface>
 gfxPlatformGtk::CreateOffscreenSurface(const IntSize& aSize,
                                        gfxImageFormat aFormat)
 {
+    if (!Factory::AllowedSurfaceSize(aSize)) {
+        return nullptr;
+    }
+
     RefPtr<gfxASurface> newSurface;
     bool needsClear = true;
 #ifdef MOZ_X11
     // XXX we really need a different interface here, something that passes
     // in more context, including the display and/or target surface type that
     // we should try to match
     GdkScreen *gdkScreen = gdk_screen_get_default();
     if (gdkScreen) {
--- a/gfx/thebes/gfxPlatformMac.cpp
+++ b/gfx/thebes/gfxPlatformMac.cpp
@@ -111,16 +111,20 @@ gfxPlatformMac::CreatePlatformFontList()
     gfxPlatformFontList::Shutdown();
     return nullptr;
 }
 
 already_AddRefed<gfxASurface>
 gfxPlatformMac::CreateOffscreenSurface(const IntSize& aSize,
                                        gfxImageFormat aFormat)
 {
+    if (!Factory::AllowedSurfaceSize(aSize)) {
+        return nullptr;
+    }
+
     RefPtr<gfxASurface> newSurface =
       new gfxQuartzSurface(aSize, aFormat);
     return newSurface.forget();
 }
 
 already_AddRefed<ScaledFont>
 gfxPlatformMac::GetScaledFontForFont(DrawTarget* aTarget, gfxFont *aFont)
 {
--- a/gfx/thebes/gfxWindowsPlatform.cpp
+++ b/gfx/thebes/gfxWindowsPlatform.cpp
@@ -580,16 +580,20 @@ gfxWindowsPlatform::DisableD2D(FeatureSt
   Factory::SetDirect3D11Device(nullptr);
   UpdateBackendPrefs();
 }
 
 already_AddRefed<gfxASurface>
 gfxWindowsPlatform::CreateOffscreenSurface(const IntSize& aSize,
                                            gfxImageFormat aFormat)
 {
+    if (!Factory::AllowedSurfaceSize(aSize)) {
+        return nullptr;
+    }
+
     RefPtr<gfxASurface> surf = nullptr;
 
 #ifdef CAIRO_HAS_WIN32_SURFACE
     if (mRenderMode == RENDER_GDI || mRenderMode == RENDER_DIRECT2D)
         surf = new gfxWindowsSurface(aSize, aFormat);
 #endif
 
     if (!surf || surf->CairoStatus()) {
--- a/image/VectorImage.cpp
+++ b/image/VectorImage.cpp
@@ -869,17 +869,17 @@ VectorImage::Draw(gfxContext* aContext,
   // drawing parameters, use that.
   RefPtr<gfxDrawable> svgDrawable = LookupCachedSurface(params);
   if (svgDrawable) {
     Show(svgDrawable, params);
     return DrawResult::SUCCESS;
   }
 
   // We didn't get a hit in the surface cache, so we'll need to rerasterize.
-  CreateSurfaceAndShow(params);
+  CreateSurfaceAndShow(params, aContext->GetDrawTarget()->GetBackendType());
   return DrawResult::SUCCESS;
 }
 
 already_AddRefed<gfxDrawable>
 VectorImage::LookupCachedSurface(const SVGDrawingParameters& aParams)
 {
   // If we're not allowed to use a cached surface, don't attempt a lookup.
   if (aParams.flags & FLAG_BYPASS_SURFACE_CACHE) {
@@ -908,17 +908,17 @@ VectorImage::LookupCachedSurface(const S
   }
 
   RefPtr<gfxDrawable> svgDrawable =
     new gfxSurfaceDrawable(sourceSurface, result.Surface()->GetSize());
   return svgDrawable.forget();
 }
 
 void
-VectorImage::CreateSurfaceAndShow(const SVGDrawingParameters& aParams)
+VectorImage::CreateSurfaceAndShow(const SVGDrawingParameters& aParams, BackendType aBackend)
 {
   mSVGDocumentWrapper->UpdateViewportBounds(aParams.viewportSize);
   mSVGDocumentWrapper->FlushImageTransformInvalidation();
 
   RefPtr<gfxDrawingCallback> cb =
     new SVGDrawingCallback(mSVGDocumentWrapper,
                            IntRect(IntPoint(0, 0), aParams.viewportSize),
                            aParams.size,
@@ -946,17 +946,18 @@ VectorImage::CreateSurfaceAndShow(const 
   SurfaceCache::UnlockEntries(ImageKey(this));
 
   // Try to create an imgFrame, initializing the surface it contains by drawing
   // our gfxDrawable into it. (We use FILTER_NEAREST since we never scale here.)
   NotNull<RefPtr<imgFrame>> frame = WrapNotNull(new imgFrame);
   nsresult rv =
     frame->InitWithDrawable(svgDrawable, aParams.size,
                             SurfaceFormat::B8G8R8A8,
-                            SamplingFilter::POINT, aParams.flags);
+                            SamplingFilter::POINT, aParams.flags,
+                            aBackend);
 
   // If we couldn't create the frame, it was probably because it would end
   // up way too big. Generally it also wouldn't fit in the cache, but the prefs
   // could be set such that the cache isn't the limiting factor.
   if (NS_FAILED(rv)) {
     return Show(svgDrawable, aParams);
   }
 
--- a/image/VectorImage.h
+++ b/image/VectorImage.h
@@ -78,17 +78,18 @@ protected:
   virtual nsresult StopAnimation() override;
   virtual bool     ShouldAnimate() override;
 
 private:
   /// Attempt to find a cached surface matching @aParams in the SurfaceCache.
   already_AddRefed<gfxDrawable>
     LookupCachedSurface(const SVGDrawingParameters& aParams);
 
-  void CreateSurfaceAndShow(const SVGDrawingParameters& aParams);
+  void CreateSurfaceAndShow(const SVGDrawingParameters& aParams,
+                            gfx::BackendType aBackend);
   void Show(gfxDrawable* aDrawable, const SVGDrawingParameters& aParams);
 
   nsresult Init(const char* aMimeType, uint32_t aFlags);
 
   /**
    * In catastrophic circumstances like a GPU driver crash, we may lose our
    * surfaces even if they're locked. RecoverFromLossOfSurfaces discards all
    * existing surfaces, allowing us to recover.
--- a/image/imgFrame.cpp
+++ b/image/imgFrame.cpp
@@ -266,17 +266,18 @@ imgFrame::InitForDecoder(const nsIntSize
   return NS_OK;
 }
 
 nsresult
 imgFrame::InitWithDrawable(gfxDrawable* aDrawable,
                            const nsIntSize& aSize,
                            const SurfaceFormat aFormat,
                            SamplingFilter aSamplingFilter,
-                           uint32_t aImageFlags)
+                           uint32_t aImageFlags,
+                           gfx::BackendType aBackend)
 {
   // Assert for properties that should be verified by decoders,
   // warn for properties related to bad content.
   if (!AllowedImageSize(aSize.width, aSize.height)) {
     NS_WARNING("Should have legal image size");
     mAborted = true;
     return NS_ERROR_FAILURE;
   }
@@ -331,18 +332,23 @@ imgFrame::InitWithDrawable(gfxDrawable* 
                             mFormat);
   } else {
     // We can't use data surfaces for content, so we'll create an offscreen
     // surface instead.  This means if someone later calls RawAccessRef(), we
     // may have to do an expensive readback, but we warned callers about that in
     // the documentation for this method.
     MOZ_ASSERT(!mOptSurface, "Called imgFrame::InitWithDrawable() twice?");
 
-    target = gfxPlatform::GetPlatform()->
-      CreateOffscreenContentDrawTarget(mFrameRect.Size(), mFormat);
+    if (gfxPlatform::GetPlatform()->SupportsAzureContentForType(aBackend)) {
+      target = gfxPlatform::GetPlatform()->
+        CreateDrawTargetForBackend(aBackend, mFrameRect.Size(), mFormat);
+    } else {
+      target = gfxPlatform::GetPlatform()->
+        CreateOffscreenContentDrawTarget(mFrameRect.Size(), mFormat);
+    }
   }
 
   if (!target || !target->IsValid()) {
     mAborted = true;
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   // Draw using the drawable the caller provided.
@@ -389,22 +395,25 @@ imgFrame::CanOptimizeOpaqueImage()
   // This optimization is free and safe, so we always do it when we can except
   // if we have a Skia backend. Skia doesn't support RGBX so ensure we don't
   // optimize to a RGBX surface.
   return mHasNoAlpha && mFormat == SurfaceFormat::B8G8R8A8 && mImageSurface &&
          (gfxPlatform::GetPlatform()->GetDefaultContentBackend() != BackendType::SKIA);
 }
 
 nsresult
-imgFrame::Optimize()
+imgFrame::Optimize(DrawTarget* aTarget)
 {
   MOZ_ASSERT(NS_IsMainThread());
   mMonitor.AssertCurrentThreadOwns();
-  MOZ_ASSERT(mLockCount == 1,
-             "Should only optimize when holding the lock exclusively");
+  
+  if (mLockCount > 0 || !mOptimizable) {
+    // Don't optimize right now.
+    return NS_OK;
+  }
 
   // Check whether image optimization is disabled -- not thread safe!
   static bool gDisableOptimize = false;
   static bool hasCheckedOptimize = false;
   if (!hasCheckedOptimize) {
     if (PR_GetEnv("MOZ_DISABLE_IMAGE_OPTIMIZE")) {
       gDisableOptimize = true;
     }
@@ -417,17 +426,17 @@ imgFrame::Optimize()
   }
 
   // This optimization is basically free, so we perform it even if optimization is disabled.
   if (CanOptimizeOpaqueImage()) {
     mFormat = SurfaceFormat::B8G8R8X8;
     mImageSurface = CreateLockedSurface(mVBuf, mFrameRect.Size(), mFormat);
   }
 
-  if (!mOptimizable || gDisableOptimize) {
+  if (gDisableOptimize) {
     return NS_OK;
   }
 
   if (mPalettedImageData || mOptSurface) {
     return NS_OK;
   }
 
   // XXX(seth): It's currently unclear if there's any reason why we can't
@@ -449,16 +458,17 @@ imgFrame::Optimize()
     // it'll get freed below.
     mVBuf = nullptr;
   }
 
   // Release all strong references to our volatile buffer's memory. This will
   // allow the operating system to free the memory if it needs to.
   mVBufPtr = nullptr;
   mImageSurface = nullptr;
+  mOptimizable = false;
 
   return NS_OK;
 }
 
 DrawableFrameRef
 imgFrame::DrawableRef()
 {
   return DrawableFrameRef(this);
@@ -543,16 +553,20 @@ bool imgFrame::Draw(gfxContext* aContext
 
   if (mPalettedImageData) {
     MOZ_ASSERT_UNREACHABLE("Directly drawing a paletted image!");
     return false;
   }
 
   MonitorAutoLock lock(mMonitor);
 
+  // Possibly convert this image into a GPU texture, this may also cause our
+  // mImageSurface to be released and the OS to release the underlying memory.
+  Optimize(aContext->GetDrawTarget());
+
   bool doPartialDecode = !AreAllPixelsWritten();
 
   RefPtr<SourceSurface> surf = GetSourceSurfaceInternal();
   if (!surf) {
     return false;
   }
 
   gfxRect imageRect(0, 0, mImageSize.width, mImageSize.height);
@@ -744,60 +758,29 @@ void
 imgFrame::AssertImageDataLocked() const
 {
 #ifdef DEBUG
   MonitorAutoLock lock(mMonitor);
   MOZ_ASSERT(mLockCount > 0, "Image data should be locked");
 #endif
 }
 
-class UnlockImageDataRunnable : public Runnable
-{
-public:
-  explicit UnlockImageDataRunnable(imgFrame* aTarget)
-    : mTarget(aTarget)
-  {
-    MOZ_ASSERT(mTarget);
-  }
-
-  NS_IMETHOD Run() override { return mTarget->UnlockImageData(); }
-
-private:
-  RefPtr<imgFrame> mTarget;
-};
-
 nsresult
 imgFrame::UnlockImageData()
 {
   MonitorAutoLock lock(mMonitor);
 
   MOZ_ASSERT(mLockCount > 0, "Unlocking an unlocked image!");
   if (mLockCount <= 0) {
     return NS_ERROR_FAILURE;
   }
 
   MOZ_ASSERT(mLockCount > 1 || mFinished || mAborted,
              "Should have Finish()'d or aborted before unlocking");
 
-  // If we're about to become unlocked, we don't need to hold on to our data
-  // surface anymore. (But we don't need to do anything for paletted images,
-  // which don't have surfaces.)
-  if (mLockCount == 1 && !mPalettedImageData) {
-    // We can't safely optimize off-main-thread, so create a runnable to do it.
-    if (!NS_IsMainThread()) {
-      nsCOMPtr<nsIRunnable> runnable = new UnlockImageDataRunnable(this);
-      NS_DispatchToMainThread(runnable);
-      return NS_OK;
-    }
-
-    // Convert our data surface to a GPU surface if possible and release
-    // whatever memory we can.
-    Optimize();
-  }
-
   mLockCount--;
 
   return NS_OK;
 }
 
 void
 imgFrame::SetOptimizable()
 {
--- a/image/imgFrame.h
+++ b/image/imgFrame.h
@@ -225,22 +225,26 @@ public:
    * Initialize this imgFrame with a new surface and draw the provided
    * gfxDrawable into it.
    *
    * This is appropriate to use when drawing content into an imgFrame, as it
    * uses the same graphics backend as normal content drawing. The downside is
    * that the underlying surface may not be stored in a volatile buffer on all
    * platforms, and raw access to the surface (using RawAccessRef()) may be much
    * more expensive than in the InitForDecoder() case.
+   *
+   * aBackend specifies the DrawTarget backend type this imgFrame is supposed
+   *          to be drawn to.
    */
   nsresult InitWithDrawable(gfxDrawable* aDrawable,
                             const nsIntSize& aSize,
                             const SurfaceFormat aFormat,
                             SamplingFilter aSamplingFilter,
-                            uint32_t aImageFlags);
+                            uint32_t aImageFlags,
+                            gfx::BackendType aBackend);
 
   DrawableFrameRef DrawableRef();
   RawAccessFrameRef RawAccessRef();
 
   /**
    * Make this imgFrame permanently available for raw access.
    *
    * This is irrevocable, and should be avoided whenever possible, since it
@@ -343,17 +347,17 @@ public:
 
 private: // methods
 
   ~imgFrame();
 
   nsresult LockImageData();
   nsresult UnlockImageData();
   bool     CanOptimizeOpaqueImage();
-  nsresult Optimize();
+  nsresult Optimize(gfx::DrawTarget* aTarget);
 
   void AssertImageDataLocked() const;
 
   bool AreAllPixelsWritten() const;
   nsresult ImageUpdatedInternal(const nsIntRect& aUpdateRect);
   void GetImageDataInternal(uint8_t** aData, uint32_t* length) const;
   uint32_t GetImageBytesPerRow() const;
   uint32_t GetImageDataLength() const;
--- a/js/src/asmjs/WasmBinaryToAST.cpp
+++ b/js/src/asmjs/WasmBinaryToAST.cpp
@@ -15,16 +15,17 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 #include "asmjs/WasmBinaryToAST.h"
 
 #include "mozilla/CheckedInt.h"
 #include "mozilla/MathAlgorithms.h"
+#include "mozilla/Sprintf.h"
 
 #include "asmjs/WasmBinaryIterator.h"
 
 using namespace js;
 using namespace js::wasm;
 
 using mozilla::CheckedInt;
 using mozilla::FloorLog2;
@@ -114,17 +115,17 @@ class AstDecodeContext
     }
 };
 
 static bool
 AstDecodeFail(AstDecodeContext& c, const char* str)
 {
     uint32_t offset = c.d.currentOffset();
     char offsetStr[sizeof "4294967295"];
-    snprintf(offsetStr, sizeof offsetStr, "%" PRIu32, offset);
+    SprintfLiteral(offsetStr, "%" PRIu32, offset);
     JS_ReportErrorNumber(c.cx, GetErrorMessage, nullptr, JSMSG_WASM_DECODE_FAIL, offsetStr, str);
     return false;
 }
 
 static bool
 AstDecodeGenerateName(AstDecodeContext& c, const AstName& prefix, uint32_t index, AstName* name)
 {
     if (!c.generateNames) {
--- a/js/src/builtin/Profilers.cpp
+++ b/js/src/builtin/Profilers.cpp
@@ -3,16 +3,18 @@
  * 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/. */
 
 /* Profiling-related API */
 
 #include "builtin/Profilers.h"
 
+#include "mozilla/Sprintf.h"
+
 #include <stdarg.h>
 
 #ifdef MOZ_CALLGRIND
 # include <valgrind/callgrind.h>
 #endif
 
 #ifdef __APPLE__
 #ifdef MOZ_INSTRUMENTS
@@ -41,20 +43,18 @@ static char gLastError[2000];
 static void
 #ifdef __GNUC__
 __attribute__((format(printf,1,2)))
 #endif
 UnsafeError(const char* format, ...)
 {
     va_list args;
     va_start(args, format);
-    (void) vsnprintf(gLastError, sizeof(gLastError), format, args);
+    (void) VsprintfLiteral(gLastError, format, args);
     va_end(args);
-
-    gLastError[sizeof(gLastError) - 1] = '\0';
 }
 #endif
 
 JS_PUBLIC_API(const char*)
 JS_UnsafeGetLastProfilingError()
 {
     return gLastError;
 }
@@ -503,17 +503,17 @@ bool js_StartPerf()
 
     pid_t mainPid = getpid();
 
     pid_t childPid = fork();
     if (childPid == 0) {
         /* perf record --pid $mainPID --output=$outfile $MOZ_PROFILE_PERF_FLAGS */
 
         char mainPidStr[16];
-        snprintf(mainPidStr, sizeof(mainPidStr), "%d", mainPid);
+        SprintfLiteral(mainPidStr, "%d", mainPid);
         const char* defaultArgs[] = {"perf", "record", "--pid", mainPidStr, "--output", outfile};
 
         Vector<const char*, 0, SystemAllocPolicy> args;
         if (!args.append(defaultArgs, ArrayLength(defaultArgs)))
             return false;
 
         const char* flags = getenv("MOZ_PROFILE_PERF_FLAGS");
         if (!flags) {
--- a/js/src/builtin/SIMD.cpp
+++ b/js/src/builtin/SIMD.cpp
@@ -10,16 +10,17 @@
  * https://github.com/johnmccutchan/ecmascript_simd/blob/master/src/ecmascript_simd.js
  * The objects float32x4 and int32x4 are installed on the SIMD pseudo-module.
  */
 
 #include "builtin/SIMD.h"
 
 #include "mozilla/FloatingPoint.h"
 #include "mozilla/IntegerTypeTraits.h"
+#include "mozilla/Sprintf.h"
 
 #include "jsapi.h"
 #include "jsfriendapi.h"
 #include "jsnum.h"
 #include "jsprf.h"
 
 #include "builtin/TypedObject.h"
 #include "jit/InlinableNatives.h"
@@ -128,17 +129,17 @@ ErrorBadArgs(JSContext* cx)
     return false;
 }
 
 static inline bool
 ErrorWrongTypeArg(JSContext* cx, unsigned argIndex, Handle<TypeDescr*> typeDescr)
 {
     MOZ_ASSERT(argIndex < 10);
     char charArgIndex[2];
-    snprintf(charArgIndex, sizeof charArgIndex, "%u", argIndex);
+    SprintfLiteral(charArgIndex, "%u", argIndex);
 
     HeapSlot& typeNameSlot = typeDescr->getReservedSlotRef(JS_DESCR_SLOT_STRING_REPR);
     char* typeNameStr = JS_EncodeString(cx, typeNameSlot.toString());
     if (!typeNameStr)
         return false;
 
     JS_ReportErrorNumber(cx, GetErrorMessage, nullptr, JSMSG_SIMD_NOT_A_VECTOR,
                          typeNameStr, charArgIndex);
--- a/js/src/builtin/TestingFunctions.cpp
+++ b/js/src/builtin/TestingFunctions.cpp
@@ -474,20 +474,25 @@ SetAllowRelazification(JSContext* cx, bo
 
 static bool
 RelazifyFunctions(JSContext* cx, unsigned argc, Value* vp)
 {
     // Relazifying functions on GC is usually only done for compartments that are
     // not active. To aid fuzzing, this testing function allows us to relazify
     // even if the compartment is active.
 
+    CallArgs args = CallArgsFromVp(argc, vp);
     SetAllowRelazification(cx, true);
-    bool res = GC(cx, argc, vp);
+
+    JS::PrepareForFullGC(cx);
+    JS::GCForReason(cx, GC_SHRINK, JS::gcreason::API);
+
     SetAllowRelazification(cx, false);
-    return res;
+    args.rval().setUndefined();
+    return true;
 }
 
 static bool
 IsProxy(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     if (args.length() != 1) {
         JS_ReportError(cx, "the function takes exactly one argument");
@@ -2134,16 +2139,20 @@ class CloneBufferObject : public NativeO
 
         if (hasTransferable) {
             JS_ReportError(cx, "cannot retrieve structured clone buffer with transferables");
             return false;
         }
 
         size_t size = obj->data()->Size();
         UniqueChars buffer(static_cast<char*>(js_malloc(size)));
+        if (!buffer) {
+            ReportOutOfMemory(cx);
+            return false;
+        }
         auto iter = obj->data()->Iter();
         obj->data()->ReadBytes(iter, buffer.get(), size);
         JSString* str = JS_NewStringCopyN(cx, buffer.get(), size);
         if (!str)
             return false;
         args.rval().setString(str);
         return true;
     }
--- a/js/src/ctypes/CTypes.h
+++ b/js/src/ctypes/CTypes.h
@@ -1,16 +1,17 @@
 /* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
 /* 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 ctypes_CTypes_h
 #define ctypes_CTypes_h
 
+#include "mozilla/Sprintf.h"
 #include "mozilla/Vector.h"
 
 #include "ffi.h"
 #include "jsalloc.h"
 #include "jsprf.h"
 #include "prlink.h"
 
 #include "ctypes/typedefs.h"
@@ -59,17 +60,17 @@ AppendChars(mozilla::Vector<T, N, AP>& v
     v[i + vlen] = c;
 }
 
 template <class T, size_t N, class AP>
 void
 AppendUInt(mozilla::Vector<T, N, AP>& v, unsigned n)
 {
   char array[16];
-  size_t alen = snprintf(array, sizeof(array), "%u", n);
+  size_t alen = SprintfLiteral(array, "%u", n);
   size_t vlen = v.length();
   if (!v.resize(vlen + alen))
     return;
 
   for (size_t i = 0; i < alen; ++i)
     v[i + vlen] = array[i];
 }
 
--- a/js/src/frontend/NameFunctions.cpp
+++ b/js/src/frontend/NameFunctions.cpp
@@ -1,16 +1,18 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * 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 "frontend/NameFunctions.h"
 
+#include "mozilla/Sprintf.h"
+
 #include "jsfun.h"
 #include "jsprf.h"
 
 #include "frontend/BytecodeCompiler.h"
 #include "frontend/ParseNode.h"
 #include "frontend/SharedContext.h"
 #include "vm/StringBuffer.h"
 
@@ -50,17 +52,17 @@ class NameResolver
         /* Quote the string as needed. */
         JSString* source = QuoteString(cx, name, '"');
         return source && buf->append('[') && buf->append(source) && buf->append(']');
     }
 
     /* Append a number to buf. */
     bool appendNumber(double n) {
         char number[30];
-        int digits = snprintf(number, sizeof(number), "%g", n);
+        int digits = SprintfLiteral(number, "%g", n);
         return buf->append(number, digits);
     }
 
     /* Append "[<n>]" to buf, referencing a property named by a numeric literal. */
     bool appendNumericPropertyReference(double n) {
         return buf->append("[") && appendNumber(n) && buf->append(']');
     }
 
--- a/js/src/gc/Nursery.cpp
+++ b/js/src/gc/Nursery.cpp
@@ -115,16 +115,17 @@ js::Nursery::Nursery(JSRuntime* rt)
   , currentStartChunk_(0)
   , currentStartPosition_(0)
   , currentEnd_(0)
   , currentChunk_(0)
   , maxNurseryChunks_(0)
   , previousPromotionRate_(0)
   , profileThreshold_(0)
   , enableProfiling_(false)
+  , reportTenurings_(0)
   , minorGcCount_(0)
   , freeMallocedBuffersTask(nullptr)
   , sweepActions_(nullptr)
 #ifdef JS_GC_ZEAL
   , lastCanary_(nullptr)
 #endif
 {}
 
@@ -154,23 +155,33 @@ js::Nursery::init(uint32_t maxNurseryByt
 
     setCurrentChunk(0);
     setStartPosition();
 
     char* env = getenv("JS_GC_PROFILE_NURSERY");
     if (env) {
         if (0 == strcmp(env, "help")) {
             fprintf(stderr, "JS_GC_PROFILE_NURSERY=N\n"
-                    "\tReport minor GC's taking more than N microseconds.\n");
+                    "\tReport minor GC's taking at least N microseconds.\n");
             exit(0);
         }
         enableProfiling_ = true;
         profileThreshold_ = atoi(env);
     }
 
+    env = getenv("JS_GC_REPORT_TENURING");
+    if (env) {
+        if (0 == strcmp(env, "help")) {
+            fprintf(stderr, "JS_GC_REPORT_TENURING=N\n"
+                    "\tAfter a minor GC, report any ObjectGroups with at least N instances tenured.\n");
+            exit(0);
+        }
+        reportTenurings_ = atoi(env);
+    }
+
     PodZero(&startTimes_);
     PodZero(&profileTimes_);
     PodZero(&totalTimes_);
 
     if (!runtime()->gc.storeBuffer.enable())
         return false;
 
     MOZ_ASSERT(isEnabled());
@@ -572,18 +583,17 @@ js::Nursery::collect(JSRuntime* rt, JS::
     // If we are promoting the nursery, or exhausted the store buffer with
     // pointers to nursery things, which will force a collection well before
     // the nursery is full, look for object groups that are getting promoted
     // excessively and try to pretenure them.
     maybeStartProfile(ProfileKey::Pretenure);
     uint32_t pretenureCount = 0;
     if (promotionRate > 0.8 || reason == JS::gcreason::FULL_STORE_BUFFER) {
         JSContext* cx = rt->contextFromMainThread();
-        for (size_t i = 0; i < ArrayLength(tenureCounts.entries); i++) {
-            const TenureCount& entry = tenureCounts.entries[i];
+        for (auto& entry : tenureCounts.entries) {
             if (entry.count >= 3000) {
                 ObjectGroup* group = entry.group;
                 if (group->canPreTenure()) {
                     AutoCompartment ac(cx, group->compartment());
                     group->setShouldPreTenure(cx);
                     pretenureCount++;
                 }
             }
@@ -618,16 +628,25 @@ js::Nursery::collect(JSRuntime* rt, JS::
             printProfileHeader();
         }
 
         fprintf(stderr, "MinorGC: %20s %5.1f%% %4u ",
                 JS::gcreason::ExplainReason(reason),
                 promotionRate * 100,
                 numChunks());
         printProfileTimes(profileTimes_);
+
+        if (reportTenurings_) {
+            for (auto& entry : tenureCounts.entries) {
+                if (entry.count >= reportTenurings_) {
+                    fprintf(stderr, "%d x ", entry.count);
+                    entry.group->print();
+                }
+            }
+        }
     }
 }
 
 double
 js::Nursery::doCollection(JSRuntime* rt, JS::gcreason::Reason reason,
                           TenureCountCache& tenureCounts)
 {
     AutoTraceSession session(rt, JS::HeapState::MinorCollecting);
--- a/js/src/gc/Nursery.h
+++ b/js/src/gc/Nursery.h
@@ -300,20 +300,23 @@ class Nursery
     unsigned currentChunk_;
 
     /* Maximum number of chunks to allocate for the nursery. */
     unsigned maxNurseryChunks_;
 
     /* Promotion rate for the previous minor collection. */
     double previousPromotionRate_;
 
-    /* Report minor collections taking more than this many us, if enabled. */
+    /* Report minor collections taking at least this many us, if enabled. */
     int64_t profileThreshold_;
     bool enableProfiling_;
 
+    /* Report ObjectGroups with at lest this many instances tenured. */
+    int64_t reportTenurings_;
+
     /* Profiling data. */
 
     enum class ProfileKey
     {
 #define DEFINE_TIME_KEY(name, text)                                           \
         name,
         FOR_EACH_NURSERY_PROFILE_TIME(DEFINE_TIME_KEY)
 #undef DEFINE_TIME_KEY
--- a/js/src/gc/Verifier.cpp
+++ b/js/src/gc/Verifier.cpp
@@ -4,16 +4,17 @@
  * 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/. */
 
 #ifdef MOZ_VALGRIND
 # include <valgrind/memcheck.h>
 #endif
 
 #include "mozilla/IntegerPrintfMacros.h"
+#include "mozilla/Sprintf.h"
 
 #include "jscntxt.h"
 #include "jsgc.h"
 #include "jsprf.h"
 
 #include "gc/GCInternals.h"
 #include "gc/Zone.h"
 #include "js/GCAPI.h"
@@ -301,17 +302,17 @@ AssertMarkedOrAllocated(const EdgeValue&
 
     // Permanent atoms and well-known symbols aren't marked during graph traversal.
     if (edge.kind == JS::TraceKind::String && static_cast<JSString*>(edge.thing)->isPermanentAtom())
         return;
     if (edge.kind == JS::TraceKind::Symbol && static_cast<JS::Symbol*>(edge.thing)->isWellKnownSymbol())
         return;
 
     char msgbuf[1024];
-    snprintf(msgbuf, sizeof(msgbuf), "[barrier verifier] Unmarked edge: %s", edge.label);
+    SprintfLiteral(msgbuf, "[barrier verifier] Unmarked edge: %s", edge.label);
     MOZ_ReportAssertionFailure(msgbuf, __FILE__, __LINE__);
     MOZ_CRASH();
 }
 
 void
 gc::GCRuntime::endVerifyPreBarriers()
 {
     VerifyPreTracer* trc = verifyPreData;
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/basic/bug1300904.js
@@ -0,0 +1,7 @@
+if (!('oomTest' in this))
+    quit();
+Object.getOwnPropertyNames(this);
+oomTest(function() {
+    this[0] = null;
+    Object.freeze(this);
+});
--- a/js/src/jit-test/tests/xdr/lazy.js
+++ b/js/src/jit-test/tests/xdr/lazy.js
@@ -106,34 +106,34 @@ evalWithCache(test, { assertEqBytecode: 
 // record its value by throwing away JIT code for the function.
 gczeal(0);
 
 // Ensure that decoded functions can be relazified.
 test = "function f() { }; f();"
      + "assertEq(isLazyFunction(f), false);"
      + "var expect = isRelazifiableFunction(f);";
 checkAfter = function (ctx) {
-  gc(ctx.global.f); // relazify f, if possible.
+  gc(ctx.global.f, "shrinking"); // relazify f, if possible.
   evaluate("assertEq(isLazyFunction(f), expect);", ctx);
 };
 evalWithCache(test, {
   assertEqBytecode: true,  // Check that we re-encode the same thing.
   assertEqResult: true,    // The function should remain relazifiable, if it was
                            // during the first run.
   checkAfter: checkAfter   // Check that relazifying the restored function works
                            // if the original was relazifiable.
 });
 
 // Ensure that decoded functions can be relazified, even if they have free
 // variables.
 test = "function f() { return isRelazifiableFunction(f) }; var expect = f();"
      + "assertEq(isLazyFunction(f), false);"
      + "expect";
 checkAfter = function (ctx) {
-  gc(ctx.global.f); // relazify f, if possible.
+  gc(ctx.global.f, "shrinking"); // relazify f, if possible.
   evaluate("assertEq(isLazyFunction(f), expect);", ctx);
 };
 evalWithCache(test, {
   assertEqBytecode: true,  // Check that we re-encode the same thing.
   assertEqResult: true,    // The function should remain relazifiable, if it was
                            // during the first run.
   checkAfter: checkAfter   // Check that relazifying the restored function works
                            // if the original was relazifiable.
--- a/js/src/jit/JitcodeMap.cpp
+++ b/js/src/jit/JitcodeMap.cpp
@@ -5,16 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "jit/JitcodeMap.h"
 
 #include "mozilla/DebugOnly.h"
 #include "mozilla/MathAlgorithms.h"
 #include "mozilla/Maybe.h"
 #include "mozilla/SizePrintfMacros.h"
+#include "mozilla/Sprintf.h"
 
 #include <algorithm>
 
 #include "jsprf.h"
 
 #include "gc/Marking.h"
 #include "gc/Statistics.h"
 #include "jit/BaselineJIT.h"
@@ -327,17 +328,17 @@ JitcodeGlobalEntry::createScriptString(J
     const char* filenameStr = script->filename() ? script->filename() : "(null)";
     size_t filenameLength = strlen(filenameStr);
 
     // Calculate lineno length
     bool hasLineno = false;
     size_t linenoLength = 0;
     char linenoStr[15];
     if (hasName || (script->functionNonDelazifying() || script->isForEval())) {
-        linenoLength = snprintf(linenoStr, sizeof(linenoStr), "%" PRIuSIZE, script->lineno());
+        linenoLength = SprintfLiteral(linenoStr, "%" PRIuSIZE, script->lineno());
         hasLineno = true;
     }
 
     // Full profile string for scripts with functions is:
     //      FuncName (FileName:Lineno)
     // Full profile string for scripts without functions is:
     //      FileName:Lineno
     // Full profile string for scripts without functions and without linenos is:
--- a/js/src/jit/SharedIC.cpp
+++ b/js/src/jit/SharedIC.cpp
@@ -5,16 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "jit/SharedIC.h"
 
 #include "mozilla/Casting.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/IntegerPrintfMacros.h"
 #include "mozilla/SizePrintfMacros.h"
+#include "mozilla/Sprintf.h"
 
 #include "jslibmath.h"
 #include "jstypes.h"
 
 #include "gc/Policy.h"
 #include "jit/BaselineCacheIR.h"
 #include "jit/BaselineDebugModeOSR.h"
 #include "jit/BaselineIC.h"
@@ -42,17 +43,17 @@ FallbackICSpew(JSContext* cx, ICFallback
 {
     if (JitSpewEnabled(JitSpew_BaselineICFallback)) {
         RootedScript script(cx, GetTopJitJSScript(cx));
         jsbytecode* pc = stub->icEntry()->pc(script);
 
         char fmtbuf[100];
         va_list args;
         va_start(args, fmt);
-        vsnprintf(fmtbuf, 100, fmt, args);
+        (void) VsprintfLiteral(fmtbuf, fmt, args);
         va_end(args);
 
         JitSpew(JitSpew_BaselineICFallback,
                 "Fallback hit for (%s:%" PRIuSIZE ") (pc=%" PRIuSIZE ",line=%d,uses=%d,stubs=%" PRIuSIZE "): %s",
                 script->filename(),
                 script->lineno(),
                 script->pcToOffset(pc),
                 PCToLineNumber(script, pc),
@@ -67,17 +68,17 @@ TypeFallbackICSpew(JSContext* cx, ICType
 {
     if (JitSpewEnabled(JitSpew_BaselineICFallback)) {
         RootedScript script(cx, GetTopJitJSScript(cx));
         jsbytecode* pc = stub->icEntry()->pc(script);
 
         char fmtbuf[100];
         va_list args;
         va_start(args, fmt);
-        vsnprintf(fmtbuf, 100, fmt, args);
+        (void) VsprintfLiteral(fmtbuf, fmt, args);
         va_end(args);
 
         JitSpew(JitSpew_BaselineICFallback,
                 "Type monitor fallback hit for (%s:%" PRIuSIZE ") (pc=%" PRIuSIZE ",line=%d,uses=%d,stubs=%d): %s",
                 script->filename(),
                 script->lineno(),
                 script->pcToOffset(pc),
                 PCToLineNumber(script, pc),
--- a/js/src/jit/x86-shared/AssemblerBuffer-x86-shared.cpp
+++ b/js/src/jit/x86-shared/AssemblerBuffer-x86-shared.cpp
@@ -1,24 +1,25 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * 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 "jit/x86-shared/AssemblerBuffer-x86-shared.h"
 
+#include "mozilla/Sprintf.h"
+
 #include "jsopcode.h"
 
 void js::jit::GenericAssembler::spew(const char* fmt, va_list va)
 {
     // Buffer to hold the formatted string. Note that this may contain
     // '%' characters, so do not pass it directly to printf functions.
     char buf[200];
 
-    int i = vsnprintf(buf, sizeof(buf), fmt, va);
-
+    int i = VsprintfLiteral(buf, fmt, va);
     if (i > -1) {
         if (printer)
             printer->printf("%s\n", buf);
         js::jit::JitSpew(js::jit::JitSpew_Codegen, "%s", buf);
     }
 }
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -7,16 +7,17 @@
 /*
  * JavaScript API.
  */
 
 #include "jsapi.h"
 
 #include "mozilla/FloatingPoint.h"
 #include "mozilla/PodOperations.h"
+#include "mozilla/Sprintf.h"
 
 #include <ctype.h>
 #include <stdarg.h>
 #include <string.h>
 #include <sys/stat.h>
 
 #include "jsarray.h"
 #include "jsatom.h"
@@ -115,17 +116,17 @@ using JS::ToUint32;
 #define JS_ADDRESSOF_VA_LIST(ap) (&(ap))
 #endif
 
 bool
 JS::CallArgs::requireAtLeast(JSContext* cx, const char* fnname, unsigned required) const
 {
     if (length() < required) {
         char numArgsStr[40];
-        snprintf(numArgsStr, sizeof(numArgsStr), "%u", required - 1);
+        SprintfLiteral(numArgsStr, "%u", required - 1);
         JS_ReportErrorNumber(cx, GetErrorMessage, nullptr, JSMSG_MORE_ARGS_NEEDED,
                              fnname, numArgsStr, required == 2 ? "" : "s");
         return false;
     }
 
     return true;
 }
 
--- a/js/src/jscntxt.cpp
+++ b/js/src/jscntxt.cpp
@@ -8,16 +8,17 @@
  * JS execution context.
  */
 
 #include "jscntxtinlines.h"
 
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/MemoryReporting.h"
+#include "mozilla/Sprintf.h"
 
 #include <ctype.h>
 #include <stdarg.h>
 #include <string.h>
 #ifdef ANDROID
 # include <android/log.h>
 # include <fstream>
 # include <string>
@@ -829,17 +830,17 @@ js::ReportIsNullOrUndefined(JSContext* c
 }
 
 void
 js::ReportMissingArg(JSContext* cx, HandleValue v, unsigned arg)
 {
     char argbuf[11];
     UniqueChars bytes;
 
-    snprintf(argbuf, sizeof argbuf, "%u", arg);
+    SprintfLiteral(argbuf, "%u", arg);
     if (IsFunctionObject(v)) {
         RootedAtom name(cx, v.toObject().as<JSFunction>().name());
         bytes = DecompileValueGenerator(cx, JSDVG_SEARCH_STACK, v, name);
         if (!bytes)
             return;
     }
     JS_ReportErrorNumber(cx, GetErrorMessage, nullptr,
                          JSMSG_MISSING_FUN_ARG, argbuf,
@@ -1177,17 +1178,17 @@ CompartmentChecker::check(AbstractFrameP
         check(frame.environmentChain());
 }
 #endif
 
 void
 AutoEnterOOMUnsafeRegion::crash(const char* reason)
 {
     char msgbuf[1024];
-    snprintf(msgbuf, sizeof(msgbuf), "[unhandlable oom] %s", reason);
+    SprintfLiteral(msgbuf, "[unhandlable oom] %s", reason);
     MOZ_ReportAssertionFailure(msgbuf, __FILE__, __LINE__);
     MOZ_CRASH();
 }
 
 AutoEnterOOMUnsafeRegion::AnnotateOOMAllocationSizeCallback
 AutoEnterOOMUnsafeRegion::annotateOOMSizeCallback = nullptr;
 
 void
--- a/js/src/jsexn.cpp
+++ b/js/src/jsexn.cpp
@@ -7,16 +7,17 @@
 /*
  * JS standard exception implementation.
  */
 
 #include "jsexn.h"
 
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/PodOperations.h"
+#include "mozilla/Sprintf.h"
 
 #include <string.h>
 
 #include "jsapi.h"
 #include "jscntxt.h"
 #include "jsfun.h"
 #include "jsnum.h"
 #include "jsobj.h"
@@ -698,22 +699,21 @@ ErrorReport::ReportAddonExceptionToTelem
         filename = strrchr(reportp->filename, '/');
         if (filename)
             filename++;
     }
     if (!filename) {
         filename = "FILE_NOT_FOUND";
     }
     char histogramKey[64];
-    snprintf(histogramKey, sizeof(histogramKey),
-            "%s %s %s %u",
-            addonIdChars.get(),
-            funname,
-            filename,
-            (reportp ? reportp->lineno : 0) );
+    SprintfLiteral(histogramKey, "%s %s %s %u",
+                   addonIdChars.get(),
+                   funname,
+                   filename,
+                   (reportp ? reportp->lineno : 0) );
     cx->runtime()->addTelemetry(JS_TELEMETRY_ADDON_EXCEPTIONS, 1, histogramKey);
 }
 
 bool
 ErrorReport::init(JSContext* cx, HandleValue exn,
                   SniffingBehavior sniffingBehavior)
 {
     MOZ_ASSERT(!cx->isExceptionPending());
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -3563,31 +3563,37 @@ FOR_EACH_ALLOCKIND(MAKE_CASE)
         MOZ_CRASH("Unknown AllocKind in AllocKindToAscii");
     }
 }
 #endif // DEBUG
 
 bool
 ArenaLists::checkEmptyArenaList(AllocKind kind)
 {
-    bool empty = true;
+    size_t num_live = 0;
 #ifdef DEBUG
     if (!arenaLists[kind].isEmpty()) {
+        size_t max_cells = 20;
+        char *env = getenv("JS_GC_MAX_LIVE_CELLS");
+        if (env && *env)
+            max_cells = atol(env);
         for (Arena* current = arenaLists[kind].head(); current; current = current->next) {
             for (ArenaCellIterUnderFinalize i(current); !i.done(); i.next()) {
                 Cell* t = i.get<Cell>();
                 MOZ_ASSERT(t->asTenured().isMarked(), "unmarked cells should have been finalized");
-                fprintf(stderr, "ERROR: GC found live Cell %p of kind %s at shutdown\n",
-                        t, AllocKindToAscii(kind));
-                empty = false;
+                if (++num_live <= max_cells) {
+                    fprintf(stderr, "ERROR: GC found live Cell %p of kind %s at shutdown\n",
+                            t, AllocKindToAscii(kind));
+                }
             }
         }
+        fprintf(stderr, "ERROR: GC found %" PRIuSIZE " live Cells at shutdown\n", num_live);
     }
 #endif // DEBUG
-    return empty;
+    return num_live == 0;
 }
 
 void
 GCRuntime::purgeRuntime(AutoLockForExclusiveAccess& lock)
 {
     for (GCCompartmentsIter comp(rt); !comp.done(); comp.next())
         comp->purge();
 
@@ -3836,21 +3842,26 @@ GCRuntime::beginMarkPhase(JS::gcreason::
             zone->discardJitCode(rt->defaultFreeOp());
         }
     }
 
     /*
      * Relazify functions after discarding JIT code (we can't relazify
      * functions with JIT code) and before the actual mark phase, so that
      * the current GC can collect the JSScripts we're unlinking here.
+     * We do this only when we're performing a shrinking GC, as too much
+     * relazification can cause performance issues when we have to reparse
+     * the same functions over and over.
      */
-    for (GCZonesIter zone(rt); !zone.done(); zone.next()) {
+    if (invocationKind == GC_SHRINK) {
         gcstats::AutoPhase ap(stats, gcstats::PHASE_RELAZIFY_FUNCTIONS);
-        RelazifyFunctions(zone, AllocKind::FUNCTION);
-        RelazifyFunctions(zone, AllocKind::FUNCTION_EXTENDED);
+        for (GCZonesIter zone(rt); !zone.done(); zone.next()) {
+            RelazifyFunctions(zone, AllocKind::FUNCTION);
+            RelazifyFunctions(zone, AllocKind::FUNCTION_EXTENDED);
+        }
     }
 
     startNumber = number;
 
     /*
      * We must purge the runtime at the beginning of an incremental GC. The
      * danger if we purge later is that the snapshot invariant of incremental
      * GC will be broken, as follows. If some object is reachable only through
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -2617,18 +2617,25 @@ js::PreventExtensions(JSContext* cx, Han
             MarkObjectGroupFlags(cx, obj, OBJECT_FLAG_FROZEN);
             if (!ObjectElements::FreezeElements(cx, obj.as<NativeObject>()))
                 return false;
         } else if (!NativeObject::sparsifyDenseElements(cx, obj.as<NativeObject>())) {
             return false;
         }
     }
 
-    if (!obj->setFlags(cx, BaseShape::NOT_EXTENSIBLE, JSObject::GENERATE_SHAPE))
+    if (!obj->setFlags(cx, BaseShape::NOT_EXTENSIBLE, JSObject::GENERATE_SHAPE)) {
+        // We failed to mark the object non-extensible, so reset the frozen
+        // flag on the elements.
+        MOZ_ASSERT(obj->nonProxyIsExtensible());
+        if (obj->isNative() && obj->as<NativeObject>().getElementsHeader()->isFrozen())
+            obj->as<NativeObject>().getElementsHeader()->markNotFrozen();
         return false;
+    }
+
     return result.succeed();
 }
 
 bool
 js::PreventExtensions(JSContext* cx, HandleObject obj, IntegrityLevel level)
 {
     ObjectOpResult result;
     return PreventExtensions(cx, obj, result, level) && result.checkStrict(cx, obj);
--- a/js/src/jsscript.cpp
+++ b/js/src/jsscript.cpp
@@ -10,16 +10,17 @@
 
 #include "jsscriptinlines.h"
 
 #include "mozilla/DebugOnly.h"
 #include "mozilla/MathAlgorithms.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/PodOperations.h"
 #include "mozilla/ScopeExit.h"
+#include "mozilla/Sprintf.h"
 #include "mozilla/Unused.h"
 #include "mozilla/Vector.h"
 
 #include <algorithm>
 #include <string.h>
 
 #include "jsapi.h"
 #include "jsatom.h"
@@ -1969,17 +1970,17 @@ FormatIntroducedFilename(ExclusiveContex
     // Compute the length of the string in advance, so we can allocate a
     // buffer of the right size on the first shot.
     //
     // (JS_smprintf would be perfect, as that allocates the result
     // dynamically as it formats the string, but it won't allocate from cx,
     // and wants us to use a special free function.)
     char linenoBuf[15];
     size_t filenameLen = strlen(filename);
-    size_t linenoLen = snprintf(linenoBuf, sizeof(linenoBuf), "%u", lineno);
+    size_t linenoLen = SprintfLiteral(linenoBuf, "%u", lineno);
     size_t introducerLen = strlen(introducer);
     size_t len = filenameLen                    +
                  6 /* == strlen(" line ") */    +
                  linenoLen                      +
                  3 /* == strlen(" > ") */       +
                  introducerLen                  +
                  1 /* \0 */;
     char* formatted = cx->zone()->pod_malloc<char>(len);
--- a/js/src/jswrapper.h
+++ b/js/src/jswrapper.h
@@ -323,17 +323,16 @@ class JS_FRIEND_API(SecurityWrapper) : p
     /*
      * Allow our subclasses to select the superclass behavior they want without
      * needing to specify an exact superclass.
      */
     typedef Base Permissive;
     typedef SecurityWrapper<Base> Restrictive;
 };
 
-typedef SecurityWrapper<Wrapper> SameCompartmentSecurityWrapper;
 typedef SecurityWrapper<CrossCompartmentWrapper> CrossCompartmentSecurityWrapper;
 
 extern JSObject*
 TransparentObjectWrapper(JSContext* cx, HandleObject existing, HandleObject obj);
 
 inline bool
 IsWrapper(JSObject* obj)
 {
--- a/js/src/old-configure.in
+++ b/js/src/old-configure.in
@@ -649,18 +649,16 @@ case "$target" in
 
 *-android*|*-linuxandroid*)
     AC_DEFINE(NO_PW_GECOS)
     MOZ_GFX_OPTIMIZE_MOBILE=1
     MOZ_OPTIMIZE_FLAGS="-O3"
     if test -z "$CLANG_CC"; then
        MOZ_OPTIMIZE_FLAGS="-freorder-blocks -fno-reorder-functions $MOZ_OPTIMIZE_FLAGS"
     fi
-    # The Maemo builders don't know about this flag
-    MOZ_ARM_VFP_FLAGS="-mfpu=vfp"
     ;;
 
 *-*linux*)
     if test "$GNU_CC" -o "$GNU_CXX"; then
         MOZ_PGO_OPTIMIZE_FLAGS="-O3"
         MOZ_OPTIMIZE_FLAGS="-O3"
         if test -z "$CLANG_CC"; then
            MOZ_OPTIMIZE_FLAGS="-freorder-blocks $MOZ_OPTIMIZE_FLAGS"
--- a/js/src/vm/CharacterEncoding.cpp
+++ b/js/src/vm/CharacterEncoding.cpp
@@ -2,16 +2,17 @@
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * 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 "js/CharacterEncoding.h"
 
 #include "mozilla/Range.h"
+#include "mozilla/Sprintf.h"
 
 #include <algorithm>
 #include <type_traits>
 
 #include "jscntxt.h"
 #include "jsprf.h"
 
 using namespace js;
@@ -224,32 +225,32 @@ JS::Utf8ToOneUcs4Char(const uint8_t* utf
 
     return ucs4Char;
 }
 
 static void
 ReportInvalidCharacter(JSContext* cx, uint32_t offset)
 {
     char buffer[10];
-    snprintf(buffer, 10, "%u", offset);
+    SprintfLiteral(buffer, "%u", offset);
     JS_ReportErrorFlagsAndNumber(cx, JSREPORT_ERROR, GetErrorMessage, nullptr,
                                  JSMSG_MALFORMED_UTF8_CHAR, buffer);
 }
 
 static void
 ReportBufferTooSmall(JSContext* cx, uint32_t dummy)
 {
     JS_ReportErrorNumber(cx, GetErrorMessage, nullptr, JSMSG_BUFFER_TOO_SMALL);
 }
 
 static void
 ReportTooBigCharacter(JSContext* cx, uint32_t v)
 {
     char buffer[10];
-    snprintf(buffer, 10, "0x%x", v + 0x10000);
+    SprintfLiteral(buffer, "0x%x", v + 0x10000);
     JS_ReportErrorFlagsAndNumber(cx, JSREPORT_ERROR, GetErrorMessage, nullptr,
                                  JSMSG_UTF8_CHAR_TOO_LARGE, buffer);
 }
 
 enum InflateUTF8Action {
     CountAndReportInvalids,
     CountAndIgnoreInvalids,
     AssertNoInvalids,
--- a/js/src/vm/Debugger.cpp
+++ b/js/src/vm/Debugger.cpp
@@ -3,16 +3,17 @@
  * 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 "vm/Debugger-inl.h"
 
 #include "mozilla/DebugOnly.h"
 #include "mozilla/ScopeExit.h"
+#include "mozilla/Sprintf.h"
 #include "mozilla/TypeTraits.h"
 
 #include "jscntxt.h"
 #include "jscompartment.h"
 #include "jsfriendapi.h"
 #include "jshashutil.h"
 #include "jsnum.h"
 #include "jsobj.h"
@@ -344,17 +345,17 @@ class MOZ_RAII js::EnterDebuggeeNoExecut
                 AutoCompartment ac(cx, nx->debugger().toJSObject());
                 nx->reported_ = true;
                 if (cx->options().dumpStackOnDebuggeeWouldRun()) {
                     fprintf(stdout, "Dumping stack for DebuggeeWouldRun:\n");
                     DumpBacktrace(cx);
                 }
                 const char* filename = script->filename() ? script->filename() : "(none)";
                 char linenoStr[15];
-                snprintf(linenoStr, sizeof(linenoStr), "%" PRIuSIZE, script->lineno());
+                SprintfLiteral(linenoStr, "%" PRIuSIZE, script->lineno());
                 unsigned flags = warning ? JSREPORT_WARNING : JSREPORT_ERROR;
                 return JS_ReportErrorFlagsAndNumber(cx, flags, GetErrorMessage, nullptr,
                                                     JSMSG_DEBUGGEE_WOULD_RUN,
                                                     filename, linenoStr);
             }
         }
         return true;
     }
--- a/js/src/vm/Interpreter.cpp
+++ b/js/src/vm/Interpreter.cpp
@@ -10,16 +10,17 @@
 
 #include "vm/Interpreter-inl.h"
 
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/FloatingPoint.h"
 #include "mozilla/Maybe.h"
 #include "mozilla/PodOperations.h"
+#include "mozilla/Sprintf.h"
 
 #include <string.h>
 
 #include "jsarray.h"
 #include "jsatom.h"
 #include "jscntxt.h"
 #include "jsfun.h"
 #include "jsgc.h"
@@ -4115,17 +4116,17 @@ END_CASE(JSOP_DEBUGCHECKSELFHOSTED)
 
 CASE(JSOP_IS_CONSTRUCTING)
     PUSH_MAGIC(JS_IS_CONSTRUCTING);
 END_CASE(JSOP_IS_CONSTRUCTING)
 
 DEFAULT()
 {
     char numBuf[12];
-    snprintf(numBuf, sizeof numBuf, "%d", *REGS.pc);
+    SprintfLiteral(numBuf, "%d", *REGS.pc);
     JS_ReportErrorNumber(cx, GetErrorMessage, nullptr,
                          JSMSG_BAD_BYTECODE, numBuf);
     goto error;
 }
 
 } /* interpreter loop */
 
     MOZ_CRASH("Interpreter loop exited via fallthrough");
--- a/js/src/vm/JSONParser.cpp
+++ b/js/src/vm/JSONParser.cpp
@@ -3,16 +3,17 @@
  * 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 "vm/JSONParser.h"
 
 #include "mozilla/Range.h"
 #include "mozilla/RangedPtr.h"
+#include "mozilla/Sprintf.h"
 
 #include <ctype.h>
 
 #include "jsarray.h"
 #include "jscompartment.h"
 #include "jsnum.h"
 #include "jsprf.h"
 
@@ -85,19 +86,19 @@ void
 JSONParser<CharT>::error(const char* msg)
 {
     if (errorHandling == RaiseError) {
         uint32_t column = 1, line = 1;
         getTextPosition(&column, &line);
 
         const size_t MaxWidth = sizeof("4294967295");
         char columnNumber[MaxWidth];
-        snprintf(columnNumber, sizeof columnNumber, "%" PRIu32, column);
+        SprintfLiteral(columnNumber, "%" PRIu32, column);
         char lineNumber[MaxWidth];
-        snprintf(lineNumber, sizeof lineNumber, "%" PRIu32, line);
+        SprintfLiteral(lineNumber, "%" PRIu32, line);
 
         JS_ReportErrorNumber(cx, GetErrorMessage, nullptr, JSMSG_JSON_BAD_PARSE,
                              msg, lineNumber, columnNumber);
     }
 }
 
 bool
 JSONParserBase::errorReturn()
--- a/js/src/vm/NativeObject.h
+++ b/js/src/vm/NativeObject.h
@@ -291,18 +291,24 @@ class ObjectElements
     static bool MakeElementsCopyOnWrite(ExclusiveContext* cx, NativeObject* obj);
     static bool FreezeElements(ExclusiveContext* cx, HandleNativeObject obj);
 
     bool isFrozen() const {
         return flags & FROZEN;
     }
     void freeze() {
         MOZ_ASSERT(!isFrozen());
+        MOZ_ASSERT(!isCopyOnWrite());
         flags |= FROZEN;
     }
+    void markNotFrozen() {
+        MOZ_ASSERT(isFrozen());
+        MOZ_ASSERT(!isCopyOnWrite());
+        flags &= ~FROZEN;
+    }
 
     // This is enough slots to store an object of this class. See the static
     // assertion below.
     static const size_t VALUES_PER_HEADER = 2;
 };
 
 static_assert(ObjectElements::VALUES_PER_HEADER * sizeof(HeapSlot) == sizeof(ObjectElements),
               "ObjectElements doesn't fit in the given number of slots");
--- a/js/src/vm/TypeInference.cpp
+++ b/js/src/vm/TypeInference.cpp
@@ -5,16 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "vm/TypeInference-inl.h"
 
 #include "mozilla/DebugOnly.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/PodOperations.h"
 #include "mozilla/SizePrintfMacros.h"
+#include "mozilla/Sprintf.h"
 
 #include "jsapi.h"
 #include "jscntxt.h"
 #include "jsgc.h"
 #include "jshashutil.h"
 #include "jsobj.h"
 #include "jsprf.h"
 #include "jsscript.h"
@@ -117,16 +118,43 @@ TypeSet::NonObjectTypeString(TypeSet::Ty
     }
     if (type.isUnknown())
         return "unknown";
 
     MOZ_ASSERT(type.isAnyObject());
     return "object";
 }
 
+/* static */ const char*
+TypeSet::TypeString(TypeSet::Type type)
+{
+    if (type.isPrimitive() || type.isUnknown() || type.isAnyObject())
+        return NonObjectTypeString(type);
+
+    static char bufs[4][40];
+    static unsigned which = 0;
+    which = (which + 1) & 3;
+
+    if (type.isSingleton()) {
+        JSObject* singleton = type.singletonNoBarrier();
+        snprintf(bufs[which], 40, "<%s %#" PRIxPTR ">",
+                 singleton->getClass()->name, uintptr_t(singleton));
+    } else {
+        snprintf(bufs[which], 40, "[%s * %#" PRIxPTR "]", type.groupNoBarrier()->clasp()->name, uintptr_t(type.groupNoBarrier()));
+    }
+
+    return bufs[which];
+}
+
+/* static */ const char*
+TypeSet::ObjectGroupString(ObjectGroup* group)
+{
+    return TypeString(TypeSet::ObjectType(group));
+}
+
 #ifdef DEBUG
 
 static bool InferSpewActive(SpewChannel channel)
 {
     static bool active[SPEW_COUNT];
     static bool checked = false;
     if (!checked) {
         checked = true;
@@ -189,40 +217,16 @@ js::InferSpewColor(TypeSet* types)
     static const char * const colors[] = { "\x1b[1;31m", "\x1b[1;32m", "\x1b[1;33m",
                                            "\x1b[1;34m", "\x1b[1;35m", "\x1b[1;36m",
                                            "\x1b[1;37m" };
     if (!InferSpewColorable())
         return "";
     return colors[DefaultHasher<TypeSet*>::hash(types) % 7];
 }
 
-/* static */ const char*
-TypeSet::TypeString(TypeSet::Type type)
-{
-    if (type.isPrimitive() || type.isUnknown() || type.isAnyObject())
-        return NonObjectTypeString(type);
-
-    static char bufs[4][40];
-    static unsigned which = 0;
-    which = (which + 1) & 3;
-
-    if (type.isSingleton())
-        snprintf(bufs[which], 40, "<0x%p>", (void*) type.singletonNoBarrier());
-    else
-        snprintf(bufs[which], 40, "[0x%p]", (void*) type.groupNoBarrier());
-
-    return bufs[which];
-}
-
-/* static */ const char*
-TypeSet::ObjectGroupString(ObjectGroup* group)
-{
-    return TypeString(TypeSet::ObjectType(group));
-}
-
 void
 js::InferSpew(SpewChannel channel, const char* fmt, ...)
 {
     if (!InferSpewActive(channel))
         return;
 
     va_list ap;
     va_start(ap, fmt);
@@ -235,20 +239,20 @@ js::InferSpew(SpewChannel channel, const
 MOZ_NORETURN MOZ_COLD static void
 TypeFailure(JSContext* cx, const char* fmt, ...)
 {
     char msgbuf[1024]; /* Larger error messages will be truncated */
     char errbuf[1024];
 
     va_list ap;
     va_start(ap, fmt);
-    vsnprintf(errbuf, sizeof(errbuf), fmt, ap);
+    VsprintfLiteral(errbuf, fmt, ap);
     va_end(ap);
 
-    snprintf(msgbuf, sizeof(msgbuf), "[infer failure] %s", errbuf);
+    SprintfLiteral(msgbuf, "[infer failure] %s", errbuf);
 
     /* Dump type state, even if INFERFLAGS is unset. */
     PrintTypes(cx, cx->compartment(), true);
 
     MOZ_ReportAssertionFailure(msgbuf, __FILE__, __LINE__);
     MOZ_CRASH();
 }
 
@@ -3039,18 +3043,18 @@ ObjectGroup::print()
 
     fprintf(stderr, " {");
 
     if (newScript()) {
         if (newScript()->analyzed()) {
             fprintf(stderr, "\n    newScript %d properties",
                     (int) newScript()->templateObject()->slotSpan());
             if (newScript()->initializedGroup()) {
-                fprintf(stderr, " initializedGroup %p with %d properties",
-                        newScript()->initializedGroup(), (int) newScript()->initializedShape()->slotSpan());
+                fprintf(stderr, " initializedGroup %#" PRIxPTR " with %d properties",
+                        uintptr_t(newScript()->initializedGroup()), int(newScript()->initializedShape()->slotSpan()));
             }
         } else {
             fprintf(stderr, "\n    newScript unanalyzed");
         }
     }
 
     for (unsigned i = 0; i < count; i++) {
         Property* prop = getProperty(i);
@@ -4463,17 +4467,18 @@ TypeScript::printTypes(JSContext* cx, Ha
     AutoEnterAnalysis enter(nullptr, script->zone());
 
     if (script->functionNonDelazifying())
         fprintf(stderr, "Function");
     else if (script->isForEval())
         fprintf(stderr, "Eval");
     else
         fprintf(stderr, "Main");
-    fprintf(stderr, " %p %s:%" PRIuSIZE " ", script.get(), script->filename(), script->lineno());
+    fprintf(stderr, " %#" PRIxPTR " %s:%" PRIuSIZE " ",
+            uintptr_t(script.get()), script->filename(), script->lineno());
 
     if (script->functionNonDelazifying()) {
         if (JSAtom* name = script->functionNonDelazifying()->name())
             name->dumpCharsNoNewline();
     }
 
     fprintf(stderr, "\n    this:");
     TypeScript::ThisTypes(script)->print();
--- a/js/src/vm/TypeInference.h
+++ b/js/src/vm/TypeInference.h
@@ -373,23 +373,18 @@ class TypeSet
     }
 
     static inline Type ObjectType(JSObject* obj);
     static inline Type ObjectType(ObjectGroup* group);
     static inline Type ObjectType(ObjectKey* key);
 
     static const char* NonObjectTypeString(Type type);
 
-#ifdef DEBUG
     static const char* TypeString(Type type);
     static const char* ObjectGroupString(ObjectGroup* group);
-#else
-    static const char* TypeString(Type type) { return nullptr; }
-    static const char* ObjectGroupString(ObjectGroup* group) { return nullptr; }
-#endif
 
   protected:
     /* Flags for this type set. */
     TypeFlags flags;
 
     /* Possible objects this type set can represent. */
     ObjectKey** objectSet;
 
--- a/js/xpconnect/tests/mochitest/test_bug790732.html
+++ b/js/xpconnect/tests/mochitest/test_bug790732.html
@@ -30,17 +30,16 @@ https://bugzilla.mozilla.org/show_bug.cg
   is(Ci.nsIDOMNSEvent.CLICK, Event.CLICK);
   is(Ci.nsIDOMKeyEvent, KeyEvent);
   is(Ci.nsIDOMMouseEvent, MouseEvent);
   is(Ci.nsIDOMMouseScrollEvent, MouseScrollEvent);
   is(Ci.nsIDOMMutationEvent, MutationEvent);
   is(Ci.nsIDOMSimpleGestureEvent, SimpleGestureEvent);
   is(Ci.nsIDOMUIEvent, UIEvent);
   is(Ci.nsIDOMHTMLMediaElement, HTMLMediaElement);
-  is(Ci.nsIDOMMediaError, MediaError);
   is(Ci.nsIDOMOfflineResourceList, OfflineResourceList);
   is(Ci.nsIDOMRange, Range);
   is(Ci.nsIDOMSVGLength, SVGLength);
   is(Ci.nsIDOMNodeFilter, NodeFilter);
   is(Ci.nsIDOMXPathResult, XPathResult);
 
   // Test for Bug 895231
   for (var k of Object.keys(Components.interfaces)) {
--- a/js/xpconnect/wrappers/XrayWrapper.cpp
+++ b/js/xpconnect/wrappers/XrayWrapper.cpp
@@ -2427,11 +2427,10 @@ const xpc::XrayWrapper<Base, Traits>
 xpc::XrayWrapper<Base, Traits>::singleton(0);
 
 template class PermissiveXrayXPCWN;
 template class SecurityXrayXPCWN;
 template class PermissiveXrayDOM;
 template class SecurityXrayDOM;
 template class PermissiveXrayJS;
 template class PermissiveXrayOpaque;
-template class SCSecurityXrayXPCWN;
 
 } // namespace xpc
--- a/js/xpconnect/wrappers/XrayWrapper.h
+++ b/js/xpconnect/wrappers/XrayWrapper.h
@@ -502,17 +502,16 @@ class XrayWrapper : public Base {
 };
 
 #define PermissiveXrayXPCWN xpc::XrayWrapper<js::CrossCompartmentWrapper, xpc::XPCWrappedNativeXrayTraits>
 #define SecurityXrayXPCWN xpc::XrayWrapper<js::CrossCompartmentSecurityWrapper, xpc::XPCWrappedNativeXrayTraits>
 #define PermissiveXrayDOM xpc::XrayWrapper<js::CrossCompartmentWrapper, xpc::DOMXrayTraits>
 #define SecurityXrayDOM xpc::XrayWrapper<js::CrossCompartmentSecurityWrapper, xpc::DOMXrayTraits>
 #define PermissiveXrayJS xpc::XrayWrapper<js::CrossCompartmentWrapper, xpc::JSXrayTraits>
 #define PermissiveXrayOpaque xpc::XrayWrapper<js::CrossCompartmentWrapper, xpc::OpaqueXrayTraits>
-#define SCSecurityXrayXPCWN xpc::XrayWrapper<js::SameCompartmentSecurityWrapper, xpc::XPCWrappedNativeXrayTraits>
 
 extern template class PermissiveXrayXPCWN;
 extern template class SecurityXrayXPCWN;
 extern template class PermissiveXrayDOM;
 extern template class SecurityXrayDOM;
 extern template class PermissiveXrayJS;
 extern template class PermissiveXrayOpaque;
 extern template class PermissiveXrayXPCWN;
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -2115,40 +2115,68 @@ nsLayoutUtils::GetNearestScrollableFrame
 
 // static
 nsRect
 nsLayoutUtils::GetScrolledRect(nsIFrame* aScrolledFrame,
                                const nsRect& aScrolledFrameOverflowArea,
                                const nsSize& aScrollPortSize,
                                uint8_t aDirection)
 {
+  WritingMode wm = aScrolledFrame->GetWritingMode();
+  // Potentially override the frame's direction to use the direction found
+  // by ScrollFrameHelper::GetScrolledFrameDir()
+  wm.SetDirectionFromBidiLevel(aDirection == NS_STYLE_DIRECTION_RTL ? 1 : 0);
+
   nscoord x1 = aScrolledFrameOverflowArea.x,
           x2 = aScrolledFrameOverflowArea.XMost(),
           y1 = aScrolledFrameOverflowArea.y,
           y2 = aScrolledFrameOverflowArea.YMost();
-  if (y1 < 0) {
-    y1 = 0;
-  }
-  if (aDirection != NS_STYLE_DIRECTION_RTL) {
+
+  bool horizontal = !wm.IsVertical();
+
+  // Clamp the horizontal start-edge (x1 or x2, depending whether the logical
+  // axis that corresponds to horizontal progresses from L-R or R-L).
+  // In horizontal writing mode, we need to check IsInlineReversed() to see
+  // which side to clamp; in vertical mode, it depends on the block direction.
+  if ((horizontal && !wm.IsInlineReversed()) || wm.IsVerticalLR()) {
     if (x1 < 0) {
       x1 = 0;
     }
   } else {
     if (x2 > aScrollPortSize.width) {
       x2 = aScrollPortSize.width;
     }
-    // When the scrolled frame chooses a size larger than its available width (because
-    // its padding alone is larger than the available width), we need to keep the
-    // start-edge of the scroll frame anchored to the start-edge of the scrollport.
+    // When the scrolled frame chooses a size larger than its available width
+    // (because its padding alone is larger than the available width), we need
+    // to keep the start-edge of the scroll frame anchored to the start-edge of
+    // the scrollport.
     // When the scrolled frame is RTL, this means moving it in our left-based
     // coordinate system, so we need to compensate for its extra width here by
     // effectively repositioning the frame.
-    nscoord extraWidth = std::max(0, aScrolledFrame->GetSize().width - aScrollPortSize.width);
+    nscoord extraWidth =
+      std::max(0, aScrolledFrame->GetSize().width - aScrollPortSize.width);
     x2 += extraWidth;
   }
+
+  // Similarly, clamp the vertical start-edge.
+  // In horizontal writing mode, the block direction is always top-to-bottom;
+  // in vertical writing mode, we need to check IsInlineReversed().
+  if (horizontal || !wm.IsInlineReversed()) {
+    if (y1 < 0) {
+      y1 = 0;
+    }
+  } else {
+    if (y2 > aScrollPortSize.height) {
+      y2 = aScrollPortSize.height;
+    }
+    nscoord extraHeight =
+      std::max(0, aScrolledFrame->GetSize().height - aScrollPortSize.height);
+    y2 += extraHeight;
+  }
+
   return nsRect(x1, y1, x2 - x1, y2 - y1);
 }
 
 //static
 bool
 nsLayoutUtils::HasPseudoStyle(nsIContent* aContent,
                               nsStyleContext* aStyleContext,
                               CSSPseudoElementType aPseudoElement,
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -1110,18 +1110,17 @@ nsIFrame::GetPaddingRect() const
   return GetPaddingRectRelativeToSelf() + GetPosition();
 }
 
 WritingMode
 nsIFrame::GetWritingMode(nsIFrame* aSubFrame) const
 {
   WritingMode writingMode = GetWritingMode();
 
-  if (!writingMode.IsVertical() &&
-      (StyleTextReset()->mUnicodeBidi & NS_STYLE_UNICODE_BIDI_PLAINTEXT)) {
+  if (StyleTextReset()->mUnicodeBidi & NS_STYLE_UNICODE_BIDI_PLAINTEXT) {
     nsBidiLevel frameLevel = nsBidiPresUtils::GetFrameBaseLevel(aSubFrame);
     writingMode.SetDirectionFromBidiLevel(frameLevel);
   }
 
   return writingMode;
 }
 
 nsRect
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -1409,17 +1409,17 @@ ScrollFrameHelper::ThumbMoved(nsScrollba
                               nscoord aOldPos,
                               nscoord aNewPos)
 {
   MOZ_ASSERT(aScrollbar != nullptr);
   bool isHorizontal = aScrollbar->IsXULHorizontal();
   nsPoint current = GetScrollPosition();
   nsPoint dest = current;
   if (isHorizontal) {
-    dest.x = IsLTR() ? aNewPos : aNewPos - GetScrollRange().width;
+    dest.x = IsPhysicalLTR() ? aNewPos : aNewPos - GetScrollRange().width;
   } else {
     dest.y = aNewPos;
   }
   nsRect allowedRange = GetOnePixelRangeAroundPoint(dest, isHorizontal);
 
   // Don't try to scroll if we're already at an acceptable place.
   // Don't call Contains here since Contains returns false when the point is
   // on the bottom or right edge of the rectangle.
@@ -4211,20 +4211,21 @@ ScrollFrameHelper::ScrollToRestoredPosit
 
   // if we didn't move, we still need to restore
   if (GetLogicalScrollPosition() == mLastPos) {
     // if our desired position is different to the scroll position, scroll.
     // remember that we could be incrementally loading so we may enter
     // and scroll many times.
     if (mRestorePos != mLastPos /* GetLogicalScrollPosition() */) {
       nsPoint scrollToPos = mRestorePos;
-      if (!IsLTR())
+      if (!IsPhysicalLTR()) {
         // convert from logical to physical scroll position
         scrollToPos.x = mScrollPort.x -
           (mScrollPort.XMost() - scrollToPos.x - mScrolledFrame->GetRect().width);
+      }
       nsWeakFrame weakFrame(mOuter);
       ScrollToWithOrigin(scrollToPos, nsIScrollableFrame::INSTANT,
                          nsGkAtoms::restore, nullptr);
       if (!weakFrame.IsAlive()) {
         return;
       }
       if (PageIsStillLoading()) {
         // If we're trying to do a history scroll restore, then we want to
@@ -4912,21 +4913,19 @@ void ScrollFrameHelper::PostOverflowEven
   nsRootPresContext* rpc = mOuter->PresContext()->GetRootPresContext();
   if (!rpc)
     return;
 
   mAsyncScrollPortEvent = new AsyncScrollPortEvent(this);
   rpc->AddWillPaintObserver(mAsyncScrollPortEvent.get());
 }
 
-bool
-ScrollFrameHelper::IsLTR() const
-{
-  //TODO make bidi code set these from preferences
-
+nsIFrame*
+ScrollFrameHelper::GetFrameForDir() const
+{
   nsIFrame *frame = mOuter;
   // XXX This is a bit on the slow side.
   if (mIsRoot) {
     // If we're the root scrollframe, we need the root element's style data.
     nsPresContext *presContext = mOuter->PresContext();
     nsIDocument *document = presContext->Document();
     Element *root = document->GetRootElement();
 
@@ -4940,37 +4939,37 @@ ScrollFrameHelper::IsLTR() const
 
     if (root) {
       nsIFrame *rootsFrame = root->GetPrimaryFrame();
       if (rootsFrame)
         frame = rootsFrame;
     }
   }
 
-  WritingMode wm = frame->GetWritingMode();
-  return wm.IsVertical() ? wm.IsVerticalLR() : wm.IsBidiLTR();
+  return frame;
 }
 
 bool
 ScrollFrameHelper::IsScrollbarOnRight() const
 {
   nsPresContext *presContext = mOuter->PresContext();
 
   // The position of the scrollbar in top-level windows depends on the pref
   // layout.scrollbar.side. For non-top-level elements, it depends only on the
   // directionaliy of the element (equivalent to a value of "1" for the pref).
-  if (!mIsRoot)
-    return IsLTR();
+  if (!mIsRoot) {
+    return IsPhysicalLTR();
+  }
   switch (presContext->GetCachedIntPref(kPresContext_ScrollbarSide)) {
     default:
     case 0: // UI directionality
       return presContext->GetCachedIntPref(kPresContext_BidiDirection)
              == IBMBIDI_TEXTDIRECTION_LTR;
     case 1: // Document / content directionality
-      return IsLTR();
+      return IsPhysicalLTR();
     case 2: // Always right
       return true;
     case 3: // Always left
       return false;
   }
 }
 
 bool
@@ -5815,17 +5814,17 @@ ScrollFrameHelper::GetScrolledFrameDir()
       NS_STYLE_UNICODE_BIDI_PLAINTEXT) {
     nsIFrame* childFrame = mScrolledFrame->PrincipalChildList().FirstChild();
     if (childFrame) {
       return (nsBidiPresUtils::ParagraphDirection(childFrame) == NSBIDI_LTR)
           ? NS_STYLE_DIRECTION_LTR : NS_STYLE_DIRECTION_RTL;
     }
   }
 
-  return IsLTR() ? NS_STYLE_DIRECTION_LTR : NS_STYLE_DIRECTION_RTL;
+  return IsBidiLTR() ? NS_STYLE_DIRECTION_LTR : NS_STYLE_DIRECTION_RTL;
 }
 
 nsRect
 ScrollFrameHelper::GetUnsnappedScrolledRectInternal(const nsRect& aScrolledFrameOverflowArea,
                                                     const nsSize& aScrollPortSize) const
 {
   return nsLayoutUtils::GetScrolledRect(mScrolledFrame,
                                         aScrolledFrameOverflowArea,
--- a/layout/generic/nsGfxScrollFrame.h
+++ b/layout/generic/nsGfxScrollFrame.h
@@ -185,17 +185,17 @@ public:
    * For LTR frames, the logical scroll position is the offset of the top left
    * corner of the frame from the top left corner of the scroll port (same as
    * GetScrollPosition).
    * For RTL frames, it is the offset of the top right corner of the frame from
    * the top right corner of the scroll port
    */
   nsPoint GetLogicalScrollPosition() const {
     nsPoint pt;
-    pt.x = IsLTR() ?
+    pt.x = IsPhysicalLTR() ?
       mScrollPort.x - mScrolledFrame->GetPosition().x :
       mScrollPort.XMost() - mScrolledFrame->GetRect().XMost();
     pt.y = mScrollPort.y - mScrolledFrame->GetPosition().y;
     return pt;
   }
   nsRect GetScrollRange() const;
   // Get the scroll range assuming the scrollport has size (aWidth, aHeight).
   nsRect GetScrollRange(nscoord aWidth, nscoord aHeight) const;
@@ -324,17 +324,29 @@ public:
   uint32_t GetScrollbarVisibility() const {
     return (mHasVerticalScrollbar ? nsIScrollableFrame::VERTICAL : 0) |
            (mHasHorizontalScrollbar ? nsIScrollableFrame::HORIZONTAL : 0);
   }
   nsMargin GetActualScrollbarSizes() const;
   nsMargin GetDesiredScrollbarSizes(nsBoxLayoutState* aState);
   nscoord GetNondisappearingScrollbarWidth(nsBoxLayoutState* aState,
                                            mozilla::WritingMode aVerticalWM);
-  bool IsLTR() const;
+  bool IsPhysicalLTR() const {
+    WritingMode wm = GetFrameForDir()->GetWritingMode();
+    return wm.IsVertical() ? wm.IsVerticalLR() : wm.IsBidiLTR();
+  }
+  bool IsBidiLTR() const {
+    nsIFrame* frame = GetFrameForDir();
+    return frame->StyleVisibility()->mDirection == NS_STYLE_DIRECTION_LTR;
+  }
+private:
+  nsIFrame* GetFrameForDir() const; // helper for Is{Physical,Bidi}LTR to find
+                                    // the frame whose directionality we use
+
+public:
   bool IsScrollbarOnRight() const;
   bool IsScrollingActive(nsDisplayListBuilder* aBuilder) const;
   bool IsMaybeScrollingActive() const;
   bool IsProcessingAsyncScroll() const {
     return mAsyncScroll != nullptr || mAsyncSmoothMSDScroll != nullptr;
   }
   void ResetScrollPositionForLayerPixelAlignment()
   {
@@ -1447,17 +1459,17 @@ protected:
   void ClampAndSetBounds(nsBoxLayoutState& aState, 
                          nsRect& aRect,
                          nsPoint aScrollPosition,
                          bool aRemoveOverflowAreas = false) {
     /* 
      * For RTL frames, restore the original scrolled position of the right
      * edge, then subtract the current width to find the physical position.
      */
-    if (!mHelper.IsLTR()) {
+    if (!mHelper.IsPhysicalLTR()) {
       aRect.x = mHelper.mScrollPort.XMost() - aScrollPosition.x - aRect.width;
     }
     mHelper.mScrolledFrame->SetXULBounds(aState, aRect, aRemoveOverflowAreas);
   }
 
 private:
   friend class mozilla::ScrollFrameHelper;
   ScrollFrameHelper mHelper;
new file mode 100644
--- /dev/null
+++ b/layout/reftests/writing-mode/1302389-scrolled-rect-1-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<body>
+<div style="height: 300px;
+            width: -moz-min-content;
+            font-size: 0;
+            line-height: 0;
+            border: 1px solid gray;
+            overflow: scroll;">
+  <div style="height: 100%;
+              width: 100px;
+              border: 50px solid blue;">
new file mode 100644
--- /dev/null
+++ b/layout/reftests/writing-mode/1302389-scrolled-rect-1a.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<body>
+<div style="writing-mode: vertical-lr;
+            height: 300px;
+            font-size: 0;
+            line-height: 0;
+            border: 1px solid gray;
+            overflow: scroll;">
+  <div style="height: 100%;
+              width: 100px;
+              border: 50px solid blue;">
new file mode 100644
--- /dev/null
+++ b/layout/reftests/writing-mode/1302389-scrolled-rect-1b.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<body>
+<div style="writing-mode: sideways-lr;
+            height: 300px;
+            font-size: 0;
+            line-height: 0;
+            border: 1px solid gray;
+            overflow: scroll;
+            direction: rtl;">
+  <div style="height: 100%;
+              width: 100px;
+              border: 50px solid blue;">
new file mode 100644
--- /dev/null
+++ b/layout/reftests/writing-mode/1302389-scrolled-rect-1c.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<script>
+function scroll() {
+  document.getElementsByTagName("div")[0].scrollTop = -200;
+}
+</script>
+<body onload="scroll()">
+<div style="writing-mode: vertical-lr;
+            height: 300px;
+            font-size: 0;
+            line-height: 0;
+            border: 1px solid gray;
+            overflow: scroll;
+            direction: rtl;">
+  <div style="height: 100%;
+              width: 100px;
+              border: 50px solid blue;">
new file mode 100644
--- /dev/null
+++ b/layout/reftests/writing-mode/1302389-scrolled-rect-1d.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<script>
+function scroll() {
+  document.getElementsByTagName("div")[0].scrollTop = -200;
+}
+</script>
+<body onload="scroll()">
+<div style="writing-mode: sideways-lr;
+            height: 300px;
+            font-size: 0;
+            line-height: 0;
+            border: 1px solid gray;
+            overflow: scroll;">
+  <div style="height: 100%;
+              width: 100px;
+              border: 50px solid blue;">
new file mode 100644
--- /dev/null
+++ b/layout/reftests/writing-mode/1302389-scrolled-rect-2-ref.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<script>
+function scroll() {
+  document.getElementsByTagName("div")[0].scrollTop = 200;
+}
+</script>
+<body onload="scroll()">
+<div style="height: 300px;
+            width: -moz-min-content;
+            font-size: 0;
+            line-height: 0;
+            border: 1px solid gray;
+            overflow: scroll;">
+  <div style="height: 100%;
+              width: 100px;
+              border: 50px solid blue;">
new file mode 100644
--- /dev/null
+++ b/layout/reftests/writing-mode/1302389-scrolled-rect-2a.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<body>
+<div style="writing-mode: vertical-lr;
+            height: 300px;
+            font-size: 0;
+            line-height: 0;
+            border: 1px solid gray;
+            overflow: scroll;
+            direction: rtl;">
+  <div style="height: 100%;
+              width: 100px;
+              border: 50px solid blue;">
new file mode 100644
--- /dev/null
+++ b/layout/reftests/writing-mode/1302389-scrolled-rect-2b.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<body>
+<div style="writing-mode: sideways-lr;
+            height: 300px;
+            font-size: 0;
+            line-height: 0;
+            border: 1px solid gray;
+            overflow: scroll;">
+  <div style="height: 100%;
+              width: 100px;
+              border: 50px solid blue;">
new file mode 100644
--- /dev/null
+++ b/layout/reftests/writing-mode/1302389-scrolled-rect-2c.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<script>
+function scroll() {
+  document.getElementsByTagName("div")[0].scrollTop = 200;
+}
+</script>
+<body onload="scroll()">
+<div style="writing-mode: vertical-lr;
+            height: 300px;
+            font-size: 0;
+            line-height: 0;
+            border: 1px solid gray;
+            overflow: scroll;">
+  <div style="height: 100%;
+              width: 100px;
+              border: 50px solid blue;">
new file mode 100644
--- /dev/null
+++ b/layout/reftests/writing-mode/1302389-scrolled-rect-2d.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<script>
+function scroll() {
+  document.getElementsByTagName("div")[0].scrollTop = 200;
+}
+</script>
+<body onload="scroll()">
+<div style="writing-mode: sideways-lr;
+            height: 300px;
+            font-size: 0;
+            line-height: 0;
+            border: 1px solid gray;
+            overflow: scroll;
+            direction: rtl;">
+  <div style="height: 100%;
+              width: 100px;
+              border: 50px solid blue;">
new file mode 100644
--- /dev/null
+++ b/layout/reftests/writing-mode/1302734-bidi-plaintext-1-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<style>
+div {
+  width: 50px;
+  height: 100px;
+  border: 1px solid gray;
+  display: inline-block;
+  writing-mode: vertical-rl;
+}
+</style>
+<div>x</div>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/writing-mode/1302734-bidi-plaintext-1a.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<style>
+div {
+  width: 50px;
+  height: 100px;
+  border: 1px solid gray;
+  display: inline-block;
+  writing-mode: vertical-rl;
+}
+</style>
+<!-- unicode-bidi:plaintext should resolve to LTR, ignoring the dir attribute -->
+<div dir="rtl" style="unicode-bidi:plaintext;">x</div>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/writing-mode/1302734-bidi-plaintext-1b.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<style>
+div {
+  width: 50px;
+  height: 100px;
+  border: 1px solid gray;
+  display: inline-block;
+  writing-mode: vertical-rl;
+}
+</style>
+<!-- unicode-bidi:plaintext should resolve to LTR, ignoring the direction property -->
+<div style="direction:rtl; unicode-bidi:plaintext;">x</div>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/writing-mode/1302734-bidi-plaintext-2-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<style>
+div {
+  width: 50px;
+  height: 100px;
+  border: 1px solid gray;
+  display: inline-block;
+  writing-mode: vertical-rl;
+}
+</style>
+<div style="text-align:end">x</div>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/writing-mode/1302734-bidi-plaintext-2a.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<style>
+div {
+  width: 50px;
+  height: 100px;
+  border: 1px solid gray;
+  display: inline-block;
+  writing-mode: vertical-rl;
+}
+</style>
+<!-- dir="rtl" should make the text bottom-aligned (i.e. line-right) -->
+<div dir="rtl">x</div>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/writing-mode/1302734-bidi-plaintext-2b.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<style>
+div {
+  width: 50px;
+  height: 100px;
+  border: 1px solid gray;
+  display: inline-block;
+  writing-mode: vertical-rl;
+}
+</style>
+<!-- direction:rtl should make the text bottom-aligned (i.e. line-right) -->
+<div style="direction:rtl;">x</div>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/writing-mode/1302734-bidi-plaintext-2c.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<style>
+div {
+  width: 50px;
+  height: 100px;
+  border: 1px solid gray;
+  display: inline-block;
+  writing-mode: vertical-rl;
+}
+</style>
+<!-- unicode-bidi:plaintext should resolve to RTL, ignoring the dir attribute -->
+<div dir="ltr" style="unicode-bidi:plaintext;">&rlm;x</div>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/writing-mode/1302734-bidi-plaintext-2d.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<style>
+div {
+  width: 50px;
+  height: 100px;
+  border: 1px solid gray;
+  display: inline-block;
+  writing-mode: vertical-rl;
+}
+</style>
+<!-- unicode-bidi:plaintext should resolve to RTL, ignoring the direction property -->
+<div style="direction:ltr; unicode-bidi:plaintext;">&rlm;x</div>
--- a/layout/reftests/writing-mode/reftest.list
+++ b/layout/reftests/writing-mode/reftest.list
@@ -166,14 +166,30 @@ fuzzy-if(gtkWidget||B2G,255,6) fuzzy-if(
 
 == 1216747-1.html 1216747-1-ref.html
 != 1216747-1.html 1216747-1-notref.html
 
 == 1243125-1-floats-overflowing.html 1243125-1-floats-overflowing-ref.html
 
 skip-if(Android) HTTP(..) == 1248248-1-orientation-break-glyphrun.html 1248248-1-orientation-break-glyphrun-ref.html # Android bug 1250229
 
+== 1302734-bidi-plaintext-1a.html 1302734-bidi-plaintext-1-ref.html
+== 1302734-bidi-plaintext-1b.html 1302734-bidi-plaintext-1-ref.html
+== 1302734-bidi-plaintext-2a.html 1302734-bidi-plaintext-2-ref.html
+== 1302734-bidi-plaintext-2b.html 1302734-bidi-plaintext-2-ref.html
+== 1302734-bidi-plaintext-2c.html 1302734-bidi-plaintext-2-ref.html
+== 1302734-bidi-plaintext-2d.html 1302734-bidi-plaintext-2-ref.html
+
+== 1302389-scrolled-rect-1a.html 1302389-scrolled-rect-1-ref.html
+fuzzy-if(Android,54,852) == 1302389-scrolled-rect-1b.html 1302389-scrolled-rect-1-ref.html
+fuzzy-if(Android,54,852) fuzzy-if(gtkWidget,1,25) fuzzy-if(cocoaWidget,1,2) == 1302389-scrolled-rect-1c.html 1302389-scrolled-rect-1-ref.html
+fuzzy-if(gtkWidget,1,25) fuzzy-if(cocoaWidget,1,2) == 1302389-scrolled-rect-1d.html 1302389-scrolled-rect-1-ref.html
+fuzzy-if(Android,54,852) fuzzy-if(gtkWidget,1,25) fuzzy-if(cocoaWidget,1,2) == 1302389-scrolled-rect-2a.html 1302389-scrolled-rect-2-ref.html
+fuzzy-if(gtkWidget,1,25) fuzzy-if(cocoaWidget,1,2) == 1302389-scrolled-rect-2b.html 1302389-scrolled-rect-2-ref.html
+== 1302389-scrolled-rect-2c.html 1302389-scrolled-rect-2-ref.html
+fuzzy-if(Android,54,852) == 1302389-scrolled-rect-2d.html 1302389-scrolled-rect-2-ref.html
+
 # Suite of tests from Gérard Talbot in bug 1079151
 # Frequent Windows 7 load failed: timed out waiting for test to complete (waiting for onload scripts to complete), bug 1167155 and friends
 skip-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) include abspos/reftest.list
 
 # Tests for tables with vertical writing modes
 include tables/reftest.list
--- a/layout/svg/moz.build
+++ b/layout/svg/moz.build
@@ -53,17 +53,17 @@ UNIFIED_SOURCES += [
     'SVGFELeafFrame.cpp',
     'SVGFEUnstyledLeafFrame.cpp',
     'SVGTextFrame.cpp',
     'SVGViewFrame.cpp',
 ]
 
 if CONFIG['CPU_ARCH'] == 'arm' and CONFIG['BUILD_ARM_NEON']:
     SOURCES += ['nsSVGMaskFrameNEON.cpp']
-    SOURCES['nsSVGMaskFrameNEON.cpp'].flags += ['-mfpu=neon']
+    SOURCES['nsSVGMaskFrameNEON.cpp'].flags += CONFIG['NEON_FLAGS']
 
 FINAL_LIBRARY = 'xul'
 LOCAL_INCLUDES += [
     '../../widget',
     '../base',
     '../generic',
     '../style',
     '../xul',
--- a/media/libopus/moz.build
+++ b/media/libopus/moz.build
@@ -100,15 +100,15 @@ if CONFIG['CPU_ARCH'] == 'arm' and CONFI
         ]
         CXXFLAGS += [
             '-O3',
         ]
     # These flags are a lie; they're just used to enable the requisite
     # opcodes; actual arch detection is done at runtime.
     ASFLAGS += [
         '-march=armv7-a',
-        '-mfpu=neon',
     ]
+    ASFLAGS += CONFIG['NEON_FLAGS']
 
 # Suppress warnings in third-party code.
 if CONFIG['GNU_CC']:
     if CONFIG['CLANG_CXX']:
         CFLAGS += ['-Wno-#pragma-messages']
--- a/media/libspeex_resampler/src/moz.build
+++ b/media/libspeex_resampler/src/moz.build
@@ -39,13 +39,13 @@ if CONFIG['INTEL_ARCHITECTURE'] and not 
     ]
     SOURCES['resample_sse.c'].flags += CONFIG['SSE2_FLAGS']
 
 if CONFIG['CPU_ARCH'] == 'arm' and CONFIG['BUILD_ARM_NEON']:
     DEFINES['_USE_NEON'] = True
     SOURCES += [
         'resample_neon.c'
     ]
-    SOURCES['resample_neon.c'].flags += ['-mfpu=neon']
+    SOURCES['resample_neon.c'].flags += CONFIG['NEON_FLAGS']
 
 # Suppress warnings in third-party code.
 if CONFIG['GNU_CC']:
     CFLAGS += ['-Wno-sign-compare']
--- a/media/libtheora/moz.build
+++ b/media/libtheora/moz.build
@@ -97,15 +97,15 @@ if CONFIG['GNU_AS']:
             'armidct-gnu',
             'armloop-gnu',
         ]]
 
         # These flags are a lie; they're just used to enable the requisite
         # opcodes; actual arch detection is done at runtime.
         ASFLAGS += [
             '-march=armv7-a',
-            '-mfpu=neon',
         ]
+        ASFLAGS += CONFIG['NEON_FLAGS']
 
         if CONFIG['CLANG_CXX']:
             ASFLAGS += [
                 '-no-integrated-as',
             ]
--- a/mfbt/Sprintf.h
+++ b/mfbt/Sprintf.h
@@ -7,25 +7,36 @@
 /* Provides a safer sprintf for printing to fixed-size character arrays. */
 
 #ifndef mozilla_Sprintf_h_
 #define mozilla_Sprintf_h_
 
 #include <stdio.h>
 #include <stdarg.h>
 
+#include "mozilla/Assertions.h"
+
 #ifdef __cplusplus
+
+template <size_t N>
+int VsprintfLiteral(char (&buffer)[N], const char* format, va_list args)
+{
+    MOZ_ASSERT(format != buffer);
+    int result = vsnprintf(buffer, N, format, args);
+    buffer[N - 1] = '\0';
+    return result;
+}
+
 template <size_t N>
 #if defined(__GNUC__)
   __attribute__((format(printf, 2, 3)))
 #endif
 int SprintfLiteral(char (&buffer)[N], const char* format, ...)
 {
   va_list args;
   va_start(args, format);
-  int result = vsnprintf(buffer, N, format, args);
+  int result = VsprintfLiteral(buffer, format, args);
   va_end(args);
-  buffer[N - 1] = '\0';
   return result;
 }
+
 #endif
-
 #endif  /* mozilla_Sprintf_h_ */
--- a/mobile/android/base/java/org/mozilla/gecko/search/SearchEngineManager.java
+++ b/mobile/android/base/java/org/mozilla/gecko/search/SearchEngineManager.java
@@ -563,16 +563,19 @@ public class SearchEngineManager impleme
      * with the right name. Unfortunately, we need to do this because there is no
      * other way to map the search engine "name" to the file for the search plugin.
      *
      * @param name Search engine name.
      * @return SearchEngine instance for name.
      */
     private SearchEngine createEngineFromLocale(String name) {
         final InputStream in = getInputStreamFromSearchPluginsJar("list.txt");
+        if (in == null) {
+            return null;
+        }
         final BufferedReader br = getBufferedReader(in);
 
         try {
             String identifier;
             while ((identifier = br.readLine()) != null) {
                 final InputStream pluginIn = getInputStreamFromSearchPluginsJar(identifier + ".xml");
                 // pluginIn can be null if the xml file doesn't exist which
                 // can happen with :hidden plugins
@@ -706,16 +709,19 @@ public class SearchEngineManager impleme
      */
     private String getFallbackLocale() {
         if (fallbackLocale != null) {
             return fallbackLocale;
         }
 
         final InputStream in = GeckoJarReader.getStream(
                 context, GeckoJarReader.getJarURL(context, "chrome/chrome.manifest"));
+        if (in == null) {
+            return null;
+        }
         final BufferedReader br = getBufferedReader(in);
 
         try {
             String line;
             while ((line = br.readLine()) != null) {
                 // We're looking for a line like "locale global en-US en-US/locale/en-US/global/"
                 // https://developer.mozilla.org/en/docs/Chrome_Registration#locale
                 if (line.startsWith("locale global ")) {
--- a/mobile/android/chrome/content/aboutAddons.js
+++ b/mobile/android/chrome/content/aboutAddons.js
@@ -80,22 +80,22 @@ var ContextMenus = {
       document.getElementById("contextmenu-disable").setAttribute("hidden", "true");
     }
   },
 
   enable: function(event) {
     Addons.setEnabled(true, this.target.addon);
     this.target = null;
   },
-  
+
   disable: function (event) {
     Addons.setEnabled(false, this.target.addon);
     this.target = null;
   },
-  
+
   uninstall: function (event) {
     Addons.uninstall(this.target.addon);
     this.target = null;
   }
 }
 
 function init() {
   window.addEventListener("popstate", onPopState, false);
@@ -220,16 +220,26 @@ var Addons = {
   },
 
   _createItemForAddon: function _createItemForAddon(aAddon) {
     let appManaged = (aAddon.scope == AddonManager.SCOPE_APPLICATION);
     let opType = this._getOpTypeForOperations(aAddon.pendingOperations);
     let updateable = (aAddon.permissions & AddonManager.PERM_CAN_UPGRADE) > 0;
     let uninstallable = (aAddon.permissions & AddonManager.PERM_CAN_UNINSTALL) > 0;
 
+    // TODO(matt): Add support for OPTIONS_TYPE_INLINE_BROWSER once bug 1302504 lands.
+    let optionsURL;
+    switch (aAddon.optionsType) {
+      case AddonManager.OPTIONS_TYPE_INLINE:
+        optionsURL = aAddon.optionsURL || "";
+        break;
+      default:
+        optionsURL = "";
+    }
+
     let blocked = "";
     switch(aAddon.blocklistState) {
       case Ci.nsIBlocklistService.STATE_BLOCKED:
         blocked = "blocked";
         break;
       case Ci.nsIBlocklistService.STATE_SOFTBLOCKED:
         blocked = "softBlocked";
         break;
@@ -240,17 +250,17 @@ var Addons = {
 
     let item = this._createItem(aAddon);
     item.setAttribute("isDisabled", !aAddon.isActive);
     item.setAttribute("isUnsigned", aAddon.signedState <= AddonManager.SIGNEDSTATE_MISSING);
     item.setAttribute("opType", opType);
     item.setAttribute("updateable", updateable);
     if (blocked)
       item.setAttribute("blockedStatus", blocked);
-    item.setAttribute("optionsURL", aAddon.optionsURL || "");
+    item.setAttribute("optionsURL", optionsURL);
     item.addon = aAddon;
 
     return item;
   },
 
   _getElementForAddon: function(aKey) {
     let list = document.getElementById("addons-list");
     let element = list.querySelector("div[addonID=\"" + CSS.escape(aKey) + "\"]");
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/ByteBufferInputStream.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/ByteBufferInputStream.java
@@ -21,18 +21,18 @@ class ByteBufferInputStream extends Inpu
 
     @Override
     public int available() {
         return mBuf.remaining();
     }
 
     @Override
     public void close() {
-        mBuf = null;
-        mNativeRef.release();
+        // Do nothing, we need to keep the native references around for child
+        // buffers.
     }
 
     @Override
     public int read() {
         if (!mBuf.hasRemaining() || mNativeRef.isReleased()) {
             return -1;
         }
 
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/NativeZip.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/NativeZip.java
@@ -12,16 +12,17 @@ import java.nio.ByteBuffer;
 import java.util.zip.Inflater;
 import java.util.zip.InflaterInputStream;
 
 public class NativeZip implements NativeReference {
     private static final int DEFLATE = 8;
     private static final int STORE = 0;
 
     private volatile long mObj;
+    @JNITarget
     private InputStream mInput;
 
     public NativeZip(String path) {
         mObj = getZip(path);
     }
 
     public NativeZip(InputStream input) {
         if (!(input instanceof ByteBufferInputStream)) {
@@ -33,20 +34,16 @@ public class NativeZip implements Native
         mInput = input;
     }
 
     @Override
     protected void finalize() {
         release();
     }
 
-    public void close() {
-        release();
-    }
-
     @Override
     public void release() {
         if (mObj != 0) {
             _release(mObj);
             mObj = 0;
         }
         mInput = null;
     }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/GeckoJarReader.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/util/GeckoJarReader.java
@@ -61,19 +61,16 @@ public final class GeckoJarReader {
         } finally {
             if (inputStream != null) {
                 try {
                     inputStream.close();
                 } catch (IOException ex) {
                     Log.e(LOGTAG, "Error closing stream", ex);
                 }
             }
-            if (zip != null) {
-                zip.close();
-            }
         }
 
         return bitmap;
     }
 
     public static String getText(Context context, String url) {
         Stack<String> jarUrls = parseUrl(url);
 
@@ -92,19 +89,16 @@ public final class GeckoJarReader {
         } finally {
             if (reader != null) {
                 try {
                     reader.close();
                 } catch (IOException ex) {
                     Log.e(LOGTAG, "Error closing reader", ex);
                 }
             }
-            if (zip != null) {
-                zip.close();
-            }
         }
 
         return text;
     }
 
     private static NativeZip getZipFile(Context context, String url)
             throws IOException, URISyntaxException {
         URI fileUrl = new URI(url);
--- a/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/testUnifiedTelemetryClientId.java
+++ b/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/testUnifiedTelemetryClientId.java
@@ -100,25 +100,27 @@ public class testUnifiedTelemetryClientI
     private void testJavaCreatesClientId() throws Exception {
         Log.d(LOGTAG, "testJavaCreatesClientId: start");
 
         fAssertFalse("Client id file does not exist yet", getClientIdFile().exists());
 
         final String clientIdFromJava = getClientIdFromJava();
         resetJSCache();
         final String clientIdFromJS = getClientIdFromJS();
-        fAssertEquals("Client ID from Java equals ID from JS", clientIdFromJava, clientIdFromJS);
+        // allow for the case where gecko updates the client ID after the first get
+        final String clientIdFromJavaAgain = getClientIdFromJava();
+        fAssertTrue("Client ID from Java equals ID from JS",
+            clientIdFromJava.equals(clientIdFromJS) ||
+            clientIdFromJavaAgain.equals(clientIdFromJS));
 
-        final String clientIdFromJavaAgain = getClientIdFromJava();
         final String clientIdFromJSCache = getClientIdFromJS();
         resetJSCache();
         final String clientIdFromJSFileAgain = getClientIdFromJS();
-        fAssertEquals("Same client ID retrieved from Java", clientIdFromJava, clientIdFromJavaAgain);
-        fAssertEquals("Same client ID retrieved from JS cache", clientIdFromJava, clientIdFromJSCache);
-        fAssertEquals("Same client ID retrieved from JS file", clientIdFromJava, clientIdFromJSFileAgain);
+        fAssertEquals("Same client ID retrieved from JS cache", clientIdFromJavaAgain, clientIdFromJSCache);
+        fAssertEquals("Same client ID retrieved from JS file", clientIdFromJavaAgain, clientIdFromJSFileAgain);
     }
 
     /**
      * Scenario: JS creates client ID
      *   * Fennec starts on a fresh profile
      *   * Js creates the client ID in datareporting/state.json
      *   * Java access the client ID from the same file
      *   * Assert the client IDs are the same
--- a/testing/tools/fileid/linux_fileid.cpp
+++ b/testing/tools/fileid/linux_fileid.cpp
@@ -1,51 +1,41 @@
 /* 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 <stdio.h>
+#include <string>
 
 #include "common/linux/file_id.h"
+#include "common/memory.h"
 
-//TODO: move this somewhere common, this is copied from dump_symbols.cc
-// Format the Elf file identifier in IDENTIFIER as a UUID with the
-// dashes removed.
-void FormatIdentifier(unsigned char identifier[google_breakpad::kMDGUIDSize],
-                      char result_guid[40]) {
-  char identifier_str[40];
-  google_breakpad::FileID::ConvertIdentifierToString(
-      identifier,
-      identifier_str,
-      sizeof(identifier_str));
-  int bufpos = 0;
-  for (int i = 0; identifier_str[i] != '\0'; ++i)
-    if (identifier_str[i] != '-')
-      result_guid[bufpos++] = identifier_str[i];
-  // Add an extra "0" by the end.  PDB files on Windows have an 'age'
-  // number appended to the end of the file identifier; this isn't
-  // really used or necessary on other platforms, but let's preserve
-  // the pattern.
-  result_guid[bufpos++] = '0';
-  // And null terminate.
-  result_guid[bufpos] = '\0';
-}
+using std::string;
 
+using google_breakpad::auto_wasteful_vector;
+using google_breakpad::FileID;
+using google_breakpad::PageAllocator;
 
 int main(int argc, char** argv)
 {
+
   if (argc != 2) {
     fprintf(stderr, "usage: fileid <elf file>\n");
     return 1;
   }
 
-  unsigned char identifier[google_breakpad::kMDGUIDSize];
-  google_breakpad::FileID file_id(argv[1]);
+  PageAllocator allocator;
+  auto_wasteful_vector<uint8_t, sizeof(MDGUID)> identifier(&allocator);
+  FileID file_id(argv[1]);
   if (!file_id.ElfFileIdentifier(identifier)) {
     fprintf(stderr, "%s: unable to generate file identifier\n",
             argv[1]);
     return 1;
   }
-  char result_guid[40];
-  FormatIdentifier(identifier, result_guid);
-  printf("%s\n", result_guid);
+
+  string result_guid = FileID::ConvertIdentifierToUUIDString(identifier);
+
+  // Add an extra "0" at the end.  PDB files on Windows have an 'age'
+  // number appended to the end of the file identifier; this isn't
+  // really used or necessary on other platforms, but be consistent.
+  printf("%s0\n", result_guid.c_str());
   return 0;
 }
--- a/toolkit/components/extensions/ext-downloads.js
+++ b/toolkit/components/extensions/ext-downloads.js
@@ -18,16 +18,17 @@ XPCOMUtils.defineLazyModuleGetter(this, 
                                   "resource://devtools/shared/event-emitter.js");
 
 Cu.import("resource://gre/modules/ExtensionUtils.jsm");
 const {
   ignoreEvent,
   normalizeTime,
   runSafeSync,
   SingletonEventManager,
+  PlatformInfo,
 } = ExtensionUtils;
 
 const DOWNLOAD_ITEM_FIELDS = ["id", "url", "referrer", "filename", "incognito",
                               "danger", "mime", "startTime", "endTime",
                               "estimatedEndTime", "state",
                               "paused", "canResume", "error",
                               "bytesReceived", "totalBytes",
                               "fileSize", "exists",
@@ -386,22 +387,28 @@ function queryHelper(query) {
   });
 }
 
 extensions.registerSchemaAPI("downloads", "addon_parent", context => {
   let {extension} = context;
   return {
     downloads: {
       download(options) {
-        if (options.filename != null) {
-          if (options.filename.length == 0) {
+        let {filename} = options;
+        if (filename && PlatformInfo.os === "win") {
+          // cross platform javascript code uses "/"
+          filename = filename.replace(/\//g, "\\");
+        }
+
+        if (filename != null) {
+          if (filename.length == 0) {
             return Promise.reject({message: "filename must not be empty"});
           }
 
-          let path = OS.Path.split(options.filename);
+          let path = OS.Path.split(filename);
           if (path.absolute) {
             return Promise.reject({message: "filename must not be an absolute path"});
           }
 
           if (path.components.some(component => component == "..")) {
             return Promise.reject({message: "filename must not contain back-references (..)"});
           }
         }
@@ -411,33 +418,37 @@ extensions.registerSchemaAPI("downloads"
           return Promise.reject({message: "conflictAction prompt not yet implemented"});
         }
 
         function createTarget(downloadsDir) {
           // TODO
           // if (options.saveAs) { }
 
           let target;
-          if (options.filename) {
-            target = OS.Path.join(downloadsDir, options.filename);
+          if (filename) {
+            target = OS.Path.join(downloadsDir, filename);
           } else {
             let uri = NetUtil.newURI(options.url);
 
-            let filename;
+            let remote = "download";
             if (uri instanceof Ci.nsIURL) {
-              filename = uri.fileName;
+              remote = uri.fileName;
             }
-            target = OS.Path.join(downloadsDir, filename || "download");
+            target = OS.Path.join(downloadsDir, remote);
           }
 
-          // This has a race, something else could come along and create
-          // the file between this test and them time the download code
-          // creates the target file.  But we can't easily fix it without
-          // modifying DownloadCore so we live with it for now.
-          return OS.File.exists(target).then(exists => {
+          // Create any needed subdirectories if required by filename.
+          const dir = OS.Path.dirname(target);
+          return OS.File.makeDir(dir, {from: downloadsDir}).then(() => {
+            return OS.File.exists(target);
+          }).then(exists => {
+            // This has a race, something else could come along and create
+            // the file between this test and them time the download code
+            // creates the target file.  But we can't easily fix it without
+            // modifying DownloadCore so we live with it for now.
             if (exists) {
               switch (options.conflictAction) {
                 case "uniquify":
                 default:
                   target = DownloadPaths.createNiceUniqueFile(new FileUtils.File(target)).path;
                   break;
 
                 case "overwrite":
--- a/toolkit/components/extensions/test/xpcshell/test_ext_downloads_download.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_downloads_download.js
@@ -89,20 +89,20 @@ function waitForDownloads() {
 // Create a file in the downloads directory.
 function touch(filename) {
   let file = downloadDir.clone();
   file.append(filename);
   file.create(Ci.nsIFile.NORMAL_FILE_TYPE, FileUtils.PERMS_FILE);
 }
 
 // Remove a file in the downloads directory.
-function remove(filename) {
+function remove(filename, recursive = false) {
   let file = downloadDir.clone();
   file.append(filename);
-  file.remove(false);
+  file.remove(recursive);
 }
 
 add_task(function* test_downloads() {
   setup();
 
   let extension = ExtensionTestUtils.loadExtension({
     background: `(${backgroundScript})()`,
     manifest: {
@@ -116,17 +116,18 @@ add_task(function* test_downloads() {
   }
 
   function testDownload(options, localFile, expectedSize, description) {
     return download(options).then(msg => {
       equal(msg.status, "success", `downloads.download() works with ${description}`);
       return waitForDownloads();
     }).then(() => {
       let localPath = downloadDir.clone();
-      localPath.append(localFile);
+      let parts = Array.isArray(localFile) ? localFile : [localFile];
+      parts.map(p => localPath.append(p));
       equal(localPath.fileSize, expectedSize, "Downloaded file has expected size");
       localPath.remove(false);
     });
   }
 
   yield extension.startup();
   yield extension.awaitMessage("ready");
   do_print("extension started");
@@ -135,16 +136,45 @@ add_task(function* test_downloads() {
   yield testDownload({url: FILE_URL}, FILE_NAME, FILE_LEN, "just source");
 
   // Call download() with a filename property.
   yield testDownload({
     url: FILE_URL,
     filename: "newpath.txt",
   }, "newpath.txt", FILE_LEN, "source and filename");
 
+  // Call download() with a filename with subdirs.
+  yield testDownload({
+    url: FILE_URL,
+    filename: "sub/dir/file",
+  }, ["sub", "dir", "file"], FILE_LEN, "source and filename with subdirs");
+
+  // Call download() with a filename with existing subdirs.
+  yield testDownload({
+    url: FILE_URL,
+    filename: "sub/dir/file2",
+  }, ["sub", "dir", "file2"], FILE_LEN, "source and filename with existing subdirs");
+
+  // Only run Windows path separator test on Windows.
+  if (WINDOWS) {
+    // Call download() with a filename with Windows path separator.
+    yield testDownload({
+      url: FILE_URL,
+      filename: "sub\\dir\\file3",
+    }, ["sub", "dir", "file3"], FILE_LEN, "filename with Windows path separator");
+  }
+  remove("sub", true);
+
+  // Call download(), filename with subdir, skipping parts.
+  yield testDownload({
+    url: FILE_URL,
+    filename: "skip//part",
+  }, ["skip", "part"], FILE_LEN, "source, filename, with subdir, skipping parts");
+  remove("skip", true);
+
   // Check conflictAction of "uniquify".
   touch(FILE_NAME);
   yield testDownload({
     url: FILE_URL,
     conflictAction: "uniquify",
   }, FILE_NAME_UNIQUE, FILE_LEN, "conflictAction=uniquify");
   // todo check that preexisting file was not modified?
   remove(FILE_NAME);
--- a/toolkit/components/jsdownloads/src/DownloadIntegration.jsm
+++ b/toolkit/components/jsdownloads/src/DownloadIntegration.jsm
@@ -539,17 +539,17 @@ this.DownloadIntegration = {
       return Promise.resolve({
         shouldBlock: false,
         verdict: "",
       });
     }
     let deferred = Promise.defer();
     let aReferrer = null;
     if (aDownload.source.referrer) {
-      aReferrer: NetUtil.newURI(aDownload.source.referrer);
+      aReferrer = NetUtil.newURI(aDownload.source.referrer);
     }
     gApplicationReputationService.queryReputation({
       sourceURI: NetUtil.newURI(aDownload.source.url),
       referrerURI: aReferrer,
       fileSize: aDownload.currentBytes,
       sha256Hash: hash,
       suggestedFileName: OS.Path.basename(aDownload.target.path),
       signatureInfo: sigInfo,
@@ -676,17 +676,17 @@ this.DownloadIntegration = {
       // thus we don't report this error.
       if (!(ex instanceof OS.File.Error) || ex.unixErrno != OS.Constants.libc.EPERM) {
         Cu.reportError(ex);
       }
     }
 
     let aReferrer = null;
     if (aDownload.source.referrer) {
-      aReferrer: NetUtil.newURI(aDownload.source.referrer);
+      aReferrer = NetUtil.newURI(aDownload.source.referrer);
     }
 
     gDownloadPlatform.downloadDone(NetUtil.newURI(aDownload.source.url),
                                    aReferrer,
                                    new FileUtils.File(aDownload.target.path),
                                    aDownload.contentType,
                                    aDownload.source.isPrivate);
   }),
--- a/toolkit/crashreporter/google-breakpad/.gitignore
+++ b/toolkit/crashreporter/google-breakpad/.gitignore
@@ -26,30 +26,32 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 # Ignore other VCSs.
 .svn/
 
 # Ignore common compiled artifacts.
 *~
+*.dwo
 *.o
 lib*.a
 /breakpad.pc
 /breakpad-client.pc
 /src/client/linux/linux_client_unittest_shlib
 /src/client/linux/linux_dumper_unittest_helper
 /src/processor/microdump_stackwalk
 /src/processor/minidump_dump
 /src/processor/minidump_stackwalk
 /src/tools/linux/core2md/core2md
 /src/tools/linux/dump_syms/dump_syms
 /src/tools/linux/md2core/minidump-2-core
 /src/tools/linux/symupload/minidump_upload
 /src/tools/linux/symupload/sym_upload
+/src/tools/mac/dump_syms/dump_syms
 
 # Ignore autotools generated artifacts.
 .deps
 .dirstamp
 autom4te.cache/
 /config.cache
 config.h
 /config.log
--- a/toolkit/crashreporter/google-breakpad/DEPS
+++ b/toolkit/crashreporter/google-breakpad/DEPS
@@ -30,33 +30,41 @@
 # SVN) based checkouts of Breakpad. As such, its use is entirely optional. If
 # using a manually managed SVN checkout as opposed to a gclient managed checkout
 # you can still use the hooks mechanism for generating project files by calling
 # 'gclient runhooks' rather than 'gclient sync'.
 
 deps = {
   # Logging code.
   "src/src/third_party/glog":
-    "http://google-glog.googlecode.com/svn/trunk@97",
+    "https://github.com/google/glog.git" +
+      "@v0.3.4",
 
   # Testing libraries and utilities.
-  "src/src/testing": "http://googlemock.googlecode.com/svn/trunk@408",
-  "src/src/testing/gtest": "http://googletest.googlecode.com/svn/trunk@615",
+  "src/src/testing":
+    "https://github.com/google/googlemock.git" +
+      "@release-1.7.0",
+  "src/src/testing/gtest":
+    "https://github.com/google/googletest.git" +
+      "@release-1.7.0",
 
   # Protobuf.
   "src/src/third_party/protobuf/protobuf":
-    "http://protobuf.googlecode.com/svn/trunk@407",
+    "https://github.com/google/protobuf.git" +
+      "@cb6dd4ef5f82e41e06179dcd57d3b1d9246ad6ac",
 
   # GYP project generator.
-  "src/src/tools/gyp": "http://gyp.googlecode.com/svn/trunk@1886",
+  "src/src/tools/gyp":
+    "https://chromium.googlesource.com/external/gyp/" +
+      "@e8ab0833a42691cd2184bd4c45d779e43821d3e0",
 
   # Linux syscall support.
   "src/src/third_party/lss":
     "https://chromium.googlesource.com/linux-syscall-support/" +
-      "@9292030109847793f7a6689adac1ddafb412fe14"
+      "@3f6478ac95edf86cd3da300c2c0d34a438f5dbeb",
 }
 
 hooks = [
   {
     # TODO(chrisha): Fix the GYP files so that they work without
     # --no-circular-check.
     "pattern": ".",
     "action": ["python",
--- a/toolkit/crashreporter/google-breakpad/GIT-INFO
+++ b/toolkit/crashreporter/google-breakpad/GIT-INFO
@@ -1,1 +1,1 @@
-c53ed143108948eb7e2d7ee77dc8c0d92050ce7c
+704f41ec901c419f8c321742114b415e6f5ceacc
--- a/toolkit/crashreporter/google-breakpad/Makefile.am
+++ b/toolkit/crashreporter/google-breakpad/Makefile.am
@@ -78,16 +78,19 @@ dist_doc_DATA = \
 	NEWS \
 	README.md
 
 ## Headers
 if LINUX_HOST
 includeclhdir = $(includedir)/$(PACKAGE)/client/linux/handler
 includeclh_HEADERS = $(top_srcdir)/src/client/linux/handler/*.h
 
+includecldwcdir = $(includedir)/$(PACKAGE)/client/linux/dump_writer_common
+includecldwc_HEADERS = $(top_srcdir)/src/client/linux/dump_writer_common/*.h
+
 includeclmdir = $(includedir)/$(PACKAGE)/client/linux/minidump_writer
 includeclm_HEADERS = $(top_srcdir)/src/client/linux/minidump_writer/*.h
 
 includeclcdir = $(includedir)/$(PACKAGE)/client/linux/crash_generation
 includeclc_HEADERS = $(top_srcdir)/src/client/linux/crash_generation/*.h
 
 includelssdir = $(includedir)/$(PACKAGE)/third_party/lss
 includelss_HEADERS = $(top_srcdir)/src/third_party/lss/*.h
@@ -104,21 +107,51 @@ includec_HEADERS = $(top_srcdir)/src/com
 
 includepdir = $(includedir)/$(PACKAGE)/processor
 includep_HEADERS = $(top_srcdir)/src/processor/*.h
 
 ## pkgconfig files
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA =
 
+## Common test logic
+if SYSTEM_TEST_LIBS
+TEST_CFLAGS = $(GTEST_CFLAGS) $(GMOCK_CFLAGS)
+TEST_LIBS = $(GTEST_LIBS) -lgtest_main $(GMOCK_LIBS)
+TEST_DEPS =
+else
+TEST_CFLAGS = \
+	-I$(top_srcdir)/src/testing/include \
+	-I$(top_srcdir)/src/testing/gtest/include \
+	-I$(top_srcdir)/src/testing/gtest \
+	-I$(top_srcdir)/src/testing
+TEST_LIBS = src/testing/libtesting.a
+TEST_DEPS = $(TEST_LIBS)
+endif
+
 ## Libraries
+check_LIBRARIES =
 noinst_LIBRARIES =
 lib_LIBRARIES =
 bin_PROGRAMS =
 check_PROGRAMS =
+EXTRA_PROGRAMS =
+CLEANFILES =
+
+check_LIBRARIES += src/testing/libtesting.a
+
+if !SYSTEM_TEST_LIBS
+src_testing_libtesting_a_SOURCES = \
+	src/breakpad_googletest_includes.h \
+	src/testing/gtest/src/gtest-all.cc \
+	src/testing/gtest/src/gtest_main.cc \
+	src/testing/src/gmock-all.cc
+src_testing_libtesting_a_CPPFLAGS = \
+	$(AM_CPPFLAGS) $(TEST_CFLAGS)
+endif
 
 if !DISABLE_PROCESSOR
 lib_LIBRARIES += src/libbreakpad.a
 pkgconfig_DATA += breakpad.pc
 noinst_LIBRARIES += src/third_party/libdisasm/libdisasm.a
 endif
 
 if LINUX_HOST
@@ -126,29 +159,43 @@ lib_LIBRARIES += src/client/linux/libbre
 pkgconfig_DATA += breakpad-client.pc
 
 src_client_linux_libbreakpad_client_a_SOURCES = \
 	src/client/linux/crash_generation/crash_generation_client.cc \
 	src/client/linux/crash_generation/crash_generation_server.cc \
 	src/client/linux/dump_writer_common/thread_info.cc \
 	src/client/linux/dump_writer_common/ucontext_reader.cc \
 	src/client/linux/handler/exception_handler.cc \
+	src/client/linux/handler/exception_handler.h \
 	src/client/linux/handler/minidump_descriptor.cc \
+	src/client/linux/handler/minidump_descriptor.h \
 	src/client/linux/log/log.cc \
+	src/client/linux/log/log.h \
 	src/client/linux/microdump_writer/microdump_writer.cc \
+	src/client/linux/microdump_writer/microdump_writer.h \
+	src/client/linux/minidump_writer/linux_core_dumper.cc \
 	src/client/linux/minidump_writer/linux_dumper.cc \
 	src/client/linux/minidump_writer/linux_ptrace_dumper.cc \
 	src/client/linux/minidump_writer/minidump_writer.cc \
+	src/client/minidump_file_writer-inl.h \
 	src/client/minidump_file_writer.cc \
+	src/client/minidump_file_writer.h \
 	src/common/convert_UTF.c \
+	src/common/convert_UTF.h \
 	src/common/md5.cc \
+	src/common/md5.h \
 	src/common/string_conversion.cc \
+	src/common/string_conversion.h \
+	src/common/linux/elf_core_dump.cc \
 	src/common/linux/elfutils.cc \
+	src/common/linux/elfutils.h \
 	src/common/linux/file_id.cc \
+	src/common/linux/file_id.h \
 	src/common/linux/guid_creator.cc \
+	src/common/linux/guid_creator.h \
 	src/common/linux/linux_libc_support.cc \
 	src/common/linux/memory_mapped_file.cc \
 	src/common/linux/safe_readlink.cc
 if ANDROID_HOST
 src_client_linux_libbreakpad_client_a_SOURCES += \
 	src/common/android/breakpad_getcontext.S
 endif
 endif LINUX_HOST
@@ -265,18 +312,16 @@ src_libbreakpad_a_SOURCES = \
 	src/processor/static_map.h \
 	src/processor/static_range_map-inl.h \
 	src/processor/static_range_map.h \
 	src/processor/symbolic_constants_win.cc \
 	src/processor/symbolic_constants_win.h \
 	src/processor/tokenize.cc \
 	src/processor/tokenize.h
 
-src_libbreakpad_a_LIBADD = src/third_party/libdisasm/libdisasm.a
-
 src_third_party_libdisasm_libdisasm_a_SOURCES = \
 	src/third_party/libdisasm/ia32_implicit.c \
 	src/third_party/libdisasm/ia32_implicit.h \
 	src/third_party/libdisasm/ia32_insn.c \
 	src/third_party/libdisasm/ia32_insn.h \
 	src/third_party/libdisasm/ia32_invariant.c \
 	src/third_party/libdisasm/ia32_invariant.h \
 	src/third_party/libdisasm/ia32_modrm.c \
@@ -303,27 +348,32 @@ src_third_party_libdisasm_libdisasm_a_SO
 ## Programs
 bin_PROGRAMS += \
 	src/processor/microdump_stackwalk \
 	src/processor/minidump_dump \
 	src/processor/minidump_stackwalk
 endif !DISABLE_PROCESSOR
 
 if LINUX_HOST
-bin_PROGRAMS += \
+EXTRA_PROGRAMS += \
+	src/client/linux/linux_dumper_unittest_helper
+CLEANFILES += \
 	src/client/linux/linux_dumper_unittest_helper
 
 if !DISABLE_TOOLS
 bin_PROGRAMS += \
 	src/tools/linux/core2md/core2md \
 	src/tools/linux/dump_syms/dump_syms \
 	src/tools/linux/md2core/minidump-2-core \
 	src/tools/linux/symupload/minidump_upload \
-	src/tools/linux/symupload/sym_upload \
-	src/tools/mac/dump_syms/dump_syms
+	src/tools/linux/symupload/sym_upload
+if X86_HOST
+bin_PROGRAMS += \
+	src/tools/mac/dump_syms/dump_syms_mac
+endif
 endif
 endif LINUX_HOST
 
 
 ## Tests
 if !DISABLE_PROCESSOR
 check_PROGRAMS += \
 	src/common/test_assembler_unittest \
@@ -340,38 +390,45 @@ check_PROGRAMS += \
 	src/processor/minidump_unittest \
 	src/processor/static_address_map_unittest \
 	src/processor/static_contained_range_map_unittest \
 	src/processor/static_map_unittest \
 	src/processor/static_range_map_unittest \
 	src/processor/pathname_stripper_unittest \
 	src/processor/postfix_evaluator_unittest \
 	src/processor/proc_maps_linux_unittest \
+	src/processor/range_map_shrink_down_unittest \
 	src/processor/range_map_unittest \
 	src/processor/stackwalker_amd64_unittest \
 	src/processor/stackwalker_arm_unittest \
 	src/processor/stackwalker_arm64_unittest \
 	src/processor/stackwalker_address_list_unittest \
 	src/processor/stackwalker_mips_unittest \
+	src/processor/stackwalker_mips64_unittest \
 	src/processor/stackwalker_x86_unittest \
 	src/processor/synth_minidump_unittest
 endif
 
 if LINUX_HOST
-EXTRA_PROGRAMS = \
+EXTRA_PROGRAMS += \
+	src/client/linux/linux_client_unittest_shlib
+CLEANFILES += \
 	src/client/linux/linux_client_unittest_shlib
 
 check_PROGRAMS += \
 	src/client/linux/linux_client_unittest
 
 if !DISABLE_TOOLS
 check_PROGRAMS += \
 	src/common/dumper_unittest \
-	src/common/mac/macho_reader_unittest \
 	src/tools/linux/md2core/minidump_2_core_unittest
+if X86_HOST
+check_PROGRAMS += \
+	src/common/mac/macho_reader_unittest
+endif
 endif
 endif LINUX_HOST
 
 if !DISABLE_PROCESSOR
 if SELFTEST
 check_PROGRAMS += \
 	src/processor/stackwalker_selftest
 endif SELFTEST
@@ -408,34 +465,35 @@ if ANDROID_HOST
 # On Android PTHREAD_CFLAGS is empty, and adding src/common/android/include
 # to the include path is necessary to build this program.
 src_client_linux_linux_dumper_unittest_helper_CXXFLAGS=$(AM_CXXFLAGS)
 else
 src_client_linux_linux_dumper_unittest_helper_CXXFLAGS=$(PTHREAD_CFLAGS)
 endif
 
 src_client_linux_linux_client_unittest_shlib_SOURCES = \
+	$(src_testing_libtesting_a_SOURCES) \
 	src/client/linux/handler/exception_handler_unittest.cc \
 	src/client/linux/minidump_writer/directory_reader_unittest.cc \
 	src/client/linux/minidump_writer/cpu_set_unittest.cc \
 	src/client/linux/minidump_writer/line_reader_unittest.cc \
 	src/client/linux/minidump_writer/linux_core_dumper.cc \
 	src/client/linux/minidump_writer/linux_core_dumper_unittest.cc \
 	src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc \
 	src/client/linux/minidump_writer/minidump_writer_unittest.cc \
 	src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc \
 	src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc \
 	src/common/linux/elf_core_dump.cc \
 	src/common/linux/linux_libc_support_unittest.cc \
+	src/common/linux/tests/auto_testfile.h \
 	src/common/linux/tests/crash_generator.cc \
 	src/common/memory_unittest.cc \
+	src/common/tests/auto_tempdir.h \
 	src/common/tests/file_utils.cc \
-	src/testing/gtest/src/gtest-all.cc \
-	src/testing/gtest/src/gtest_main.cc \
-	src/testing/src/gmock-all.cc \
+	src/common/tests/file_utils.h \
 	src/processor/basic_code_modules.cc \
 	src/processor/dump_context.cc \
 	src/processor/dump_object.cc \
 	src/processor/logging.cc \
 	src/processor/minidump.cc \
 	src/processor/pathname_stripper.cc \
 	src/processor/proc_maps_linux.cc
 if ANDROID_HOST
@@ -443,21 +501,17 @@ src_client_linux_linux_client_unittest_s
 	src/common/android/breakpad_getcontext.S
 endif
 if LINUX_HOST
 src_client_linux_linux_client_unittest_shlib_SOURCES += \
 	src/client/linux/microdump_writer/microdump_writer_unittest.cc
 endif
 
 src_client_linux_linux_client_unittest_shlib_CPPFLAGS = \
-	-I$(top_srcdir)/src \
-	-I$(top_srcdir)/src/testing/include \
-	-I$(top_srcdir)/src/testing/gtest/include \
-	-I$(top_srcdir)/src/testing/gtest \
-	-I$(top_srcdir)/src/testing
+	$(AM_CPPFLAGS) $(TEST_CFLAGS)
 src_client_linux_linux_client_unittest_shlib_LDFLAGS = \
 	-shared \
 	-Wl,-h,linux_client_unittest_shlib
 src_client_linux_linux_client_unittest_shlib_LDADD = \
 	src/client/linux/crash_generation/crash_generation_client.o \
 	src/client/linux/dump_writer_common/thread_info.o \
 	src/client/linux/dump_writer_common/ucontext_reader.o \
 	src/client/linux/handler/exception_handler.o \
@@ -472,108 +526,125 @@ src_client_linux_linux_client_unittest_s
 	src/common/md5.o \
 	src/common/linux/elfutils.o \
 	src/common/linux/file_id.o \
 	src/common/linux/guid_creator.o \
 	src/common/linux/linux_libc_support.o \
 	src/common/linux/memory_mapped_file.o \
 	src/common/linux/safe_readlink.o \
 	src/common/string_conversion.o \
+	$(TEST_LIBS) \
 	$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
 if ANDROID_HOST
 src_client_linux_linux_client_unittest_shlib_SOURCES += \
 	src/common/android/breakpad_getcontext_unittest.cc
 src_client_linux_linux_client_unittest_shlib_LDFLAGS += \
 	-llog -lm
 endif
 
 src_client_linux_linux_client_unittest_shlib_DEPENDENCIES = \
 	src/client/linux/linux_dumper_unittest_helper \
 	src/client/linux/libbreakpad_client.a \
+	$(TEST_DEPS) \
 	src/libbreakpad.a
 
 src_client_linux_linux_client_unittest_SOURCES =
+# The extra-long build id is for a test in minidump_writer_unittest.cc.
 src_client_linux_linux_client_unittest_LDFLAGS = \
-	-Wl,-rpath,'$$ORIGIN'
+	-Wl,-rpath,'$$ORIGIN' \
+	-Wl,--build-id=0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
 if ANDROID_HOST
 src_client_linux_linux_client_unittest_LDFLAGS += \
         -llog
 endif
 
 src_client_linux_linux_client_unittest_LDADD = \
-	src/client/linux/linux_client_unittest_shlib
+	src/client/linux/linux_client_unittest_shlib \
+	$(TEST_LIBS)
 
 src_client_linux_linux_client_unittest_DEPENDENCIES = \
 	src/client/linux/linux_client_unittest_shlib
 
 if !DISABLE_TOOLS
 src_tools_linux_core2md_core2md_SOURCES = \
-	src/tools/linux/core2md/core2md.cc \
-	src/client/linux/minidump_writer/linux_core_dumper.cc \
-	src/common/linux/elf_core_dump.cc
+	src/tools/linux/core2md/core2md.cc
 
 src_tools_linux_core2md_core2md_LDADD = \
 	src/client/linux/libbreakpad_client.a
 
 src_tools_linux_dump_syms_dump_syms_SOURCES = \
 	src/common/dwarf_cfi_to_module.cc \
 	src/common/dwarf_cu_to_module.cc \
 	src/common/dwarf_line_to_module.cc \
 	src/common/language.cc \
 	src/common/module.cc \
 	src/common/stabs_reader.cc \
 	src/common/stabs_to_module.cc \
 	src/common/dwarf/bytereader.cc \
 	src/common/dwarf/dwarf2diehandler.cc \
 	src/common/dwarf/dwarf2reader.cc \
+	src/common/dwarf/elf_reader.cc \
 	src/common/linux/crc32.cc \
 	src/common/linux/dump_symbols.cc \
+	src/common/linux/dump_symbols.h \
 	src/common/linux/elf_symbols_to_module.cc \
+	src/common/linux/elf_symbols_to_module.h \
 	src/common/linux/elfutils.cc \
 	src/common/linux/file_id.cc \
 	src/common/linux/linux_libc_support.cc \
 	src/common/linux/memory_mapped_file.cc \
 	src/common/linux/safe_readlink.cc \
 	src/tools/linux/dump_syms/dump_syms.cc
 
 src_tools_linux_md2core_minidump_2_core_SOURCES = \
 	src/common/linux/memory_mapped_file.cc \
-	src/tools/linux/md2core/minidump-2-core.cc
+	src/tools/linux/md2core/minidump-2-core.cc \
+	src/tools/linux/md2core/minidump_memory_range.h
 
 src_tools_linux_symupload_minidump_upload_SOURCES = \
 	src/common/linux/http_upload.cc \
 	src/tools/linux/symupload/minidump_upload.cc
 src_tools_linux_symupload_minidump_upload_LDADD = -ldl
 
 src_tools_linux_symupload_sym_upload_SOURCES = \
 	src/common/linux/http_upload.cc \
+	src/common/linux/http_upload.h \
+	src/common/linux/symbol_upload.cc \
+	src/common/linux/symbol_upload.h \
 	src/tools/linux/symupload/sym_upload.cc
 src_tools_linux_symupload_sym_upload_LDADD = -ldl
 
-src_tools_mac_dump_syms_dump_syms_SOURCES = \
+src_tools_mac_dump_syms_dump_syms_mac_SOURCES = \
 	src/common/dwarf_cfi_to_module.cc \
 	src/common/dwarf_cu_to_module.cc \
 	src/common/dwarf_line_to_module.cc \
 	src/common/language.cc \
 	src/common/md5.cc \
 	src/common/module.cc \
 	src/common/stabs_reader.cc \
 	src/common/stabs_to_module.cc \
 	src/common/dwarf/bytereader.cc \
 	src/common/dwarf/dwarf2diehandler.cc \
 	src/common/dwarf/dwarf2reader.cc \
+	src/common/dwarf/elf_reader.cc \
 	src/common/mac/arch_utilities.cc \
 	src/common/mac/dump_syms.cc \
+	src/common/mac/dump_syms.h \
 	src/common/mac/file_id.cc \
+	src/common/mac/file_id.h \
 	src/common/mac/macho_id.cc \
+	src/common/mac/macho_id.h \
 	src/common/mac/macho_reader.cc \
+	src/common/mac/macho_reader.h \
 	src/common/mac/macho_utilities.cc \
+	src/common/mac/macho_utilities.h \
 	src/common/mac/macho_walker.cc \
+	src/common/mac/macho_walker.h \
 	src/tools/mac/dump_syms/dump_syms_tool.cc
-src_tools_mac_dump_syms_dump_syms_CXXFLAGS= \
+src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS= \
 	-I$(top_srcdir)/src/third_party/mac_headers \
 	-DHAVE_MACH_O_NLIST_H
 
 src_common_dumper_unittest_SOURCES = \
 	src/common/byte_cursor_unittest.cc \
 	src/common/dwarf_cfi_to_module.cc \
 	src/common/dwarf_cfi_to_module_unittest.cc \
 	src/common/dwarf_cu_to_module.cc \
@@ -585,23 +656,30 @@ src_common_dumper_unittest_SOURCES = \
 	src/common/module.cc \
 	src/common/module_unittest.cc \
 	src/common/stabs_reader.cc \
 	src/common/stabs_reader_unittest.cc \
 	src/common/stabs_to_module.cc \
 	src/common/stabs_to_module_unittest.cc \
 	src/common/test_assembler.cc \
 	src/common/dwarf/bytereader.cc \
+	src/common/dwarf/bytereader.h \
+	src/common/dwarf/bytereader-inl.h \
 	src/common/dwarf/bytereader_unittest.cc \
 	src/common/dwarf/cfi_assembler.cc \
+	src/common/dwarf/cfi_assembler.h \
 	src/common/dwarf/dwarf2diehandler.cc \
 	src/common/dwarf/dwarf2diehandler_unittest.cc \
 	src/common/dwarf/dwarf2reader.cc \
+	src/common/dwarf/dwarf2reader.h \
+	src/common/dwarf/elf_reader.cc \
+	src/common/dwarf/elf_reader.h \
 	src/common/dwarf/dwarf2reader_cfi_unittest.cc \
 	src/common/dwarf/dwarf2reader_die_unittest.cc \
+	src/common/dwarf/dwarf2reader_test_common.h \
 	src/common/linux/crc32.cc \
 	src/common/linux/dump_symbols.cc \
 	src/common/linux/dump_symbols_unittest.cc \
 	src/common/linux/elf_core_dump.cc \
 	src/common/linux/elf_core_dump_unittest.cc \
 	src/common/linux/elf_symbols_to_module.cc \
 	src/common/linux/elf_symbols_to_module_unittest.cc \
 	src/common/linux/elfutils.cc \
@@ -610,142 +688,111 @@ src_common_dumper_unittest_SOURCES = \
 	src/common/linux/linux_libc_support.cc \
 	src/common/linux/memory_mapped_file.cc \
 	src/common/linux/memory_mapped_file_unittest.cc \
 	src/common/linux/safe_readlink.cc \
 	src/common/linux/safe_readlink_unittest.cc \
 	src/common/linux/synth_elf.cc \
 	src/common/linux/synth_elf_unittest.cc \
 	src/common/linux/tests/crash_generator.cc \
-	src/common/tests/file_utils.cc \
-	src/testing/gtest/src/gtest-all.cc \
-	src/testing/gtest/src/gtest_main.cc \
-	src/testing/src/gmock-all.cc
+	src/common/linux/tests/crash_generator.h \
+	src/common/testdata/func-line-pairing.h \
+	src/common/tests/file_utils.cc
 src_common_dumper_unittest_CPPFLAGS = \
-	-I$(top_srcdir)/src \
-	-I$(top_srcdir)/src/testing/include \
-	-I$(top_srcdir)/src/testing/gtest/include \
-	-I$(top_srcdir)/src/testing/gtest \
-	-I$(top_srcdir)/src/testing \
+	$(AM_CPPFLAGS) $(TEST_CFLAGS) \
 	$(PTHREAD_CFLAGS)
-src_common_dumper_unittest_LDADD = $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
+src_common_dumper_unittest_LDADD = \
+	$(TEST_LIBS) \
+	$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
 
 src_common_mac_macho_reader_unittest_SOURCES = \
 	src/common/dwarf_cfi_to_module.cc \
 	src/common/dwarf_cu_to_module.cc \
 	src/common/dwarf_line_to_module.cc \
 	src/common/language.cc \
 	src/common/md5.cc \
 	src/common/module.cc \
 	src/common/stabs_reader.cc \
 	src/common/stabs_to_module.cc \
 	src/common/test_assembler.cc \
 	src/common/dwarf/bytereader.cc \
 	src/common/dwarf/cfi_assembler.cc \
 	src/common/dwarf/dwarf2diehandler.cc \
 	src/common/dwarf/dwarf2reader.cc \
+	src/common/dwarf/elf_reader.cc \
 	src/common/mac/arch_utilities.cc \
 	src/common/mac/file_id.cc \
 	src/common/mac/macho_id.cc \
 	src/common/mac/macho_reader.cc \
 	src/common/mac/macho_reader_unittest.cc \
 	src/common/mac/macho_utilities.cc \
 	src/common/mac/macho_walker.cc \
-	src/common/tests/file_utils.cc \
-	src/testing/gtest/src/gtest-all.cc \
-	src/testing/gtest/src/gtest_main.cc \
-	src/testing/src/gmock-all.cc
+	src/common/tests/file_utils.cc
 src_common_mac_macho_reader_unittest_CPPFLAGS = \
-	-I$(top_srcdir)/src \
-	-I$(top_srcdir)/src/testing/include \
-	-I$(top_srcdir)/src/testing/gtest/include \
-	-I$(top_srcdir)/src/testing/gtest \
-	-I$(top_srcdir)/src/testing \
+	$(AM_CPPFLAGS) $(TEST_CFLAGS) \
 	-I$(top_srcdir)/src/third_party/mac_headers \
 	-DHAVE_MACH_O_NLIST_H \
 	$(PTHREAD_CFLAGS)
-src_common_mac_macho_reader_unittest_LDADD = $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
+src_common_mac_macho_reader_unittest_LDADD = \
+	$(TEST_LIBS) \
+	$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
 endif
 
 src_tools_linux_md2core_minidump_2_core_unittest_SOURCES = \
-	src/testing/gtest/src/gtest-all.cc \
-	src/testing/gtest/src/gtest_main.cc \
-	src/testing/src/gmock-all.cc \
 	src/tools/linux/md2core/minidump_memory_range_unittest.cc
 src_tools_linux_md2core_minidump_2_core_unittest_CPPFLAGS = \
-	-I$(top_srcdir)/src \
-	-I$(top_srcdir)/src/testing/include \
-	-I$(top_srcdir)/src/testing/gtest/include \
-	-I$(top_srcdir)/src/testing/gtest \
-	-I$(top_srcdir)/src/testing
+	$(AM_CPPFLAGS) $(TEST_CFLAGS)
 src_tools_linux_md2core_minidump_2_core_unittest_LDADD = \
+	$(TEST_LIBS) \
 	$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
 
 endif LINUX_HOST
 
 if !DISABLE_PROCESSOR
 src_processor_address_map_unittest_SOURCES = \
 	src/processor/address_map_unittest.cc
 src_processor_address_map_unittest_LDADD = \
 	src/processor/logging.o \
 	src/processor/pathname_stripper.o
 
 src_processor_basic_source_line_resolver_unittest_SOURCES = \
-	src/processor/basic_source_line_resolver_unittest.cc \
-	src/testing/gtest/src/gtest-all.cc \
-	src/testing/src/gmock-all.cc
+	src/processor/basic_source_line_resolver_unittest.cc
 src_processor_basic_source_line_resolver_unittest_CPPFLAGS = \
-	-I$(top_srcdir)/src \
-	-I$(top_srcdir)/src/testing/include \
-	-I$(top_srcdir)/src/testing/gtest/include \
-	-I$(top_srcdir)/src/testing/gtest \
-	-I$(top_srcdir)/src/testing
+	$(AM_CPPFLAGS) $(TEST_CFLAGS)
 src_processor_basic_source_line_resolver_unittest_LDADD = \
 	src/processor/basic_source_line_resolver.o \
 	src/processor/cfi_frame_info.o \
 	src/processor/pathname_stripper.o \
 	src/processor/logging.o \
 	src/processor/source_line_resolver_base.o \
 	src/processor/tokenize.o \
+	$(TEST_LIBS) \
 	$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
 
 src_processor_cfi_frame_info_unittest_SOURCES = \
-	src/processor/cfi_frame_info_unittest.cc \
-	src/testing/gtest/src/gtest-all.cc \
-	src/testing/gtest/src/gtest_main.cc \
-	src/testing/src/gmock-all.cc
+	src/processor/cfi_frame_info_unittest.cc
 src_processor_cfi_frame_info_unittest_LDADD = \
 	src/processor/cfi_frame_info.o \
 	src/processor/logging.o \
 	src/processor/pathname_stripper.o \
+	$(TEST_LIBS) \
 	$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
 src_processor_cfi_frame_info_unittest_CPPFLAGS = \
-	-I$(top_srcdir)/src \
-	-I$(top_srcdir)/src/testing/include \
-	-I$(top_srcdir)/src/testing/gtest/include \
-	-I$(top_srcdir)/src/testing/gtest \
-	-I$(top_srcdir)/src/testing
+	$(AM_CPPFLAGS) $(TEST_CFLAGS)
 
 src_processor_contained_range_map_unittest_SOURCES = \
 	src/processor/contained_range_map_unittest.cc
 src_processor_contained_range_map_unittest_LDADD = \
 	src/processor/logging.o \
 	src/processor/pathname_stripper.o
 
 src_processor_exploitability_unittest_SOURCES = \
-	src/processor/exploitability_unittest.cc \
-	src/testing/gtest/src/gtest-all.cc \
-	src/testing/gtest/src/gtest_main.cc \
-	src/testing/src/gmock-all.cc
+	src/processor/exploitability_unittest.cc
 src_processor_exploitability_unittest_CPPFLAGS = \
-	-I$(top_srcdir)/src \
-	-I$(top_srcdir)/src/testing/include \
-	-I$(top_srcdir)/src/testing/gtest/include \
-	-I$(top_srcdir)/src/testing/gtest \
-	-I$(top_srcdir)/src/testing
+	$(AM_CPPFLAGS) $(TEST_CFLAGS)
 src_processor_exploitability_unittest_LDADD = \
 	src/processor/minidump_processor.o \
 	src/processor/process_state.o \
 	src/processor/disassembler_x86.o \
 	src/processor/exploitability.o \
 	src/processor/exploitability_linux.o \
 	src/processor/exploitability_win.o \
 	src/processor/basic_code_modules.o \
@@ -770,81 +817,60 @@ src_processor_exploitability_unittest_LD
 	src/processor/stackwalker_mips.o \
 	src/processor/stackwalker_ppc.o \
 	src/processor/stackwalker_ppc64.o \
 	src/processor/stackwalker_sparc.o \
 	src/processor/stackwalker_x86.o \
 	src/processor/symbolic_constants_win.o \
 	src/processor/tokenize.o \
 	src/third_party/libdisasm/libdisasm.a \
+	$(TEST_LIBS) \
 	$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
 
 src_processor_disassembler_x86_unittest_SOURCES = \
-	src/processor/disassembler_x86_unittest.cc \
-	src/testing/gtest/src/gtest-all.cc \
-	src/testing/gtest/src/gtest_main.cc \
-	src/testing/src/gmock-all.cc
+	src/processor/disassembler_x86_unittest.cc
 src_processor_disassembler_x86_unittest_CPPFLAGS = \
-	-I$(top_srcdir)/src \
-	-I$(top_srcdir)/src/testing/include \
-	-I$(top_srcdir)/src/testing/gtest/include \
-	-I$(top_srcdir)/src/testing/gtest \
-	-I$(top_srcdir)/src/testing
+	$(AM_CPPFLAGS) $(TEST_CFLAGS)
 src_processor_disassembler_x86_unittest_LDADD = \
 	src/processor/disassembler_x86.o \
 	src/third_party/libdisasm/libdisasm.a \
+	$(TEST_LIBS) \
 	$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
 
 src_processor_fast_source_line_resolver_unittest_SOURCES = \
-	src/processor/fast_source_line_resolver_unittest.cc \
-	src/testing/gtest/src/gtest-all.cc \
-	src/testing/src/gmock-all.cc
+	src/processor/fast_source_line_resolver_unittest.cc
 src_processor_fast_source_line_resolver_unittest_CPPFLAGS = \
-	-I$(top_srcdir)/src \
-	-I$(top_srcdir)/src/testing/include \
-	-I$(top_srcdir)/src/testing/gtest/include \
-	-I$(top_srcdir)/src/testing/gtest \
-	-I$(top_srcdir)/src/testing
+	$(AM_CPPFLAGS) $(TEST_CFLAGS)
 src_processor_fast_source_line_resolver_unittest_LDADD = \
 	src/processor/fast_source_line_resolver.o \
 	src/processor/basic_source_line_resolver.o \
 	src/processor/cfi_frame_info.o \
 	src/processor/module_comparer.o \
 	src/processor/module_serializer.o \
 	src/processor/pathname_stripper.o \
 	src/processor/logging.o \
 	src/processor/source_line_resolver_base.o \
 	src/processor/tokenize.o \
+	$(TEST_LIBS) \
 	$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
 
 src_processor_map_serializers_unittest_SOURCES = \
-	src/processor/map_serializers_unittest.cc \
-	src/testing/gtest/src/gtest-all.cc \
-	src/testing/src/gmock-all.cc
+	src/processor/map_serializers_unittest.cc
 src_processor_map_serializers_unittest_CPPFLAGS = \
-	-I$(top_srcdir)/src \
-	-I$(top_srcdir)/src/testing/include \
-	-I$(top_srcdir)/src/testing/gtest/include \
-	-I$(top_srcdir)/src/testing/gtest \
-	-I$(top_srcdir)/src/testing
+	$(AM_CPPFLAGS) $(TEST_CFLAGS)
 src_processor_map_serializers_unittest_LDADD = \
 	src/processor/logging.o \
 	src/processor/pathname_stripper.o \
+	$(TEST_LIBS) \
 	$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
 
 src_processor_microdump_processor_unittest_SOURCES = \
-	src/processor/microdump_processor_unittest.cc \
-	src/testing/gtest/src/gtest-all.cc \
-	src/testing/src/gmock-all.cc
+	src/processor/microdump_processor_unittest.cc
 src_processor_microdump_processor_unittest_CPPFLAGS = \
-	-I$(top_srcdir)/src \
-	-I$(top_srcdir)/src/testing/include \
-	-I$(top_srcdir)/src/testing/gtest/include \
-	-I$(top_srcdir)/src/testing/gtest \
-	-I$(top_srcdir)/src/testing
+	$(AM_CPPFLAGS) $(TEST_CFLAGS)
 src_processor_microdump_processor_unittest_LDADD = \
 	src/processor/basic_code_modules.o \
 	src/processor/basic_source_line_resolver.o \
 	src/processor/call_stack.o \
 	src/processor/cfi_frame_info.o \
 	src/processor/dump_context.o \
 	src/processor/dump_object.o \
 	src/processor/logging.o \
@@ -861,28 +887,23 @@ src_processor_microdump_processor_unitte
 	src/processor/stackwalker_arm.o \
 	src/processor/stackwalker_arm64.o \
 	src/processor/stackwalker_mips.o \
 	src/processor/stackwalker_ppc.o \
 	src/processor/stackwalker_ppc64.o \
 	src/processor/stackwalker_sparc.o \
 	src/processor/stackwalker_x86.o \
 	src/processor/tokenize.o \
+	$(TEST_LIBS) \
 	$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
 
 src_processor_minidump_processor_unittest_SOURCES = \
-	src/processor/minidump_processor_unittest.cc \
-	src/testing/gtest/src/gtest-all.cc \
-	src/testing/src/gmock-all.cc
+	src/processor/minidump_processor_unittest.cc
 src_processor_minidump_processor_unittest_CPPFLAGS = \
-	-I$(top_srcdir)/src \
-	-I$(top_srcdir)/src/testing/include \
-	-I$(top_srcdir)/src/testing/gtest/include \
-	-I$(top_srcdir)/src/testing/gtest \
-	-I$(top_srcdir)/src/testing
+	$(AM_CPPFLAGS) $(TEST_CFLAGS)
 src_processor_minidump_processor_unittest_LDADD = \
 	src/processor/basic_code_modules.o \
 	src/processor/basic_source_line_resolver.o \
 	src/processor/call_stack.o \
 	src/processor/cfi_frame_info.o \
 	src/processor/disassembler_x86.o \
 	src/processor/dump_context.o \
 	src/processor/dump_object.o \
@@ -906,132 +927,111 @@ src_processor_minidump_processor_unittes
 	src/processor/stackwalker_mips.o \
 	src/processor/stackwalker_ppc.o \
 	src/processor/stackwalker_ppc64.o \
 	src/processor/stackwalker_sparc.o \
 	src/processor/stackwalker_x86.o \
 	src/processor/symbolic_constants_win.o \
 	src/processor/tokenize.o \
 	src/third_party/libdisasm/libdisasm.a \
+	$(TEST_LIBS) \
 	$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
 
 src_processor_minidump_unittest_SOURCES = \
 	src/common/test_assembler.cc \
 	src/processor/minidump_unittest.cc \
-	src/processor/synth_minidump.cc \
-	src/testing/gtest/src/gtest-all.cc \
-	src/testing/gtest/src/gtest_main.cc \
-	src/testing/src/gmock-all.cc
+	src/processor/synth_minidump.cc
 src_processor_minidump_unittest_CPPFLAGS = \
-	-I$(top_srcdir)/src \
-	-I$(top_srcdir)/src/testing/include \
-	-I$(top_srcdir)/src/testing/gtest/include \
-	-I$(top_srcdir)/src/testing/gtest \
-	-I$(top_srcdir)/src/testing
+	$(AM_CPPFLAGS) $(TEST_CFLAGS)
 src_processor_minidump_unittest_LDADD = \
 	src/processor/basic_code_modules.o \
 	src/processor/dump_context.o \
 	src/processor/dump_object.o \
 	src/processor/logging.o \
 	src/processor/minidump.o \
 	src/processor/pathname_stripper.o \
 	src/processor/proc_maps_linux.o \
+	$(TEST_LIBS) \
 	$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
 
 src_processor_proc_maps_linux_unittest_SOURCES = \
 	src/processor/proc_maps_linux.cc \
-	src/processor/proc_maps_linux_unittest.cc \
-	src/testing/gtest/src/gtest-all.cc \
-	src/testing/gtest/src/gtest_main.cc \
-	src/testing/src/gmock-all.cc
+	src/processor/proc_maps_linux_unittest.cc
 src_processor_proc_maps_linux_unittest_CPPFLAGS = \
-	-I$(top_srcdir)/src \
-	-I$(top_srcdir)/src/testing/include \
-	-I$(top_srcdir)/src/testing/gtest/include \
-	-I$(top_srcdir)/src/testing/gtest \
-	-I$(top_srcdir)/src/testing
+	$(AM_CPPFLAGS) $(TEST_CFLAGS)
 src_processor_proc_maps_linux_unittest_LDADD = \
 	src/processor/logging.o \
 	src/processor/pathname_stripper.o \
 	src/third_party/libdisasm/libdisasm.a \
+	$(TEST_LIBS) \
 	$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
 
 src_processor_static_address_map_unittest_SOURCES = \
-	src/processor/static_address_map_unittest.cc \
-	src/testing/gtest/src/gtest-all.cc \
-	src/testing/src/gmock-all.cc
+	src/processor/static_address_map_unittest.cc
 src_processor_static_address_map_unittest_CPPFLAGS = \
-	-I$(top_srcdir)/src \
-	-I$(top_srcdir)/src/testing/include \
-	-I$(top_srcdir)/src/testing/gtest/include \
-	-I$(top_srcdir)/src/testing/gtest \
-	-I$(top_srcdir)/src/testing
+	$(AM_CPPFLAGS) $(TEST_CFLAGS)
 src_processor_static_address_map_unittest_LDADD = \
 	src/processor/logging.o \
 	src/processor/pathname_stripper.o \
+	$(TEST_LIBS) \
 	$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
 
 src_processor_static_contained_range_map_unittest_SOURCES = \
-	src/processor/static_contained_range_map_unittest.cc \
-	src/testing/gtest/src/gtest-all.cc \
-	src/testing/src/gmock-all.cc
+	src/processor/static_contained_range_map_unittest.cc
 src_processor_static_contained_range_map_unittest_CPPFLAGS = \
-	-I$(top_srcdir)/src \
-	-I$(top_srcdir)/src/testing/include \
-	-I$(top_srcdir)/src/testing/gtest/include \
-	-I$(top_srcdir)/src/testing/gtest \
-	-I$(top_srcdir)/src/testing
+	$(AM_CPPFLAGS) $(TEST_CFLAGS)
 src_processor_static_contained_range_map_unittest_LDADD = \
 	src/processor/logging.o \
 	src/processor/pathname_stripper.o \
+	$(TEST_LIBS) \
 	$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
 
 src_processor_static_map_unittest_SOURCES = \
-	src/processor/static_map_unittest.cc \
-	src/testing/gtest/src/gtest-all.cc \
-	src/testing/src/gmock-all.cc
+	src/processor/static_map_unittest.cc
 src_processor_static_map_unittest_CPPFLAGS = \
-	-I$(top_srcdir)/src \
-	-I$(top_srcdir)/src/testing/include \
-	-I$(top_srcdir)/src/testing/gtest/include \
-	-I$(top_srcdir)/src/testing/gtest \
-	-I$(top_srcdir)/src/testing
+	$(AM_CPPFLAGS) $(TEST_CFLAGS)
 src_processor_static_map_unittest_LDADD = \
 	src/processor/logging.o \
 	src/processor/pathname_stripper.o \
+	$(TEST_LIBS) \
 	$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
 
 src_processor_static_range_map_unittest_SOURCES = \
-	src/processor/static_range_map_unittest.cc \
-	src/testing/gtest/src/gtest-all.cc \
-	src/testing/src/gmock-all.cc
+	src/processor/static_range_map_unittest.cc
 src_processor_static_range_map_unittest_CPPFLAGS = \
-	-I$(top_srcdir)/src \
-	-I$(top_srcdir)/src/testing/include \
-	-I$(top_srcdir)/src/testing/gtest/include \
-	-I$(top_srcdir)/src/testing/gtest \
-	-I$(top_srcdir)/src/testing
+	$(AM_CPPFLAGS) $(TEST_CFLAGS)
 src_processor_static_range_map_unittest_LDADD = \
 	src/processor/logging.o \
 	src/processor/pathname_stripper.o \
+	$(TEST_LIBS) \
 	$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
 
 src_processor_pathname_stripper_unittest_SOURCES = \
 	src/processor/pathname_stripper_unittest.cc
 src_processor_pathname_stripper_unittest_LDADD = \
 	src/processor/pathname_stripper.o \
 	$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
 
 src_processor_postfix_evaluator_unittest_SOURCES = \
 	src/processor/postfix_evaluator_unittest.cc
 src_processor_postfix_evaluator_unittest_LDADD = \
 	src/processor/logging.o \
 	src/processor/pathname_stripper.o \
 	$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
 
+src_processor_range_map_shrink_down_unittest_SOURCES = \
+	src/processor/range_map_shrink_down_unittest.cc
+src_processor_range_map_shrink_down_unittest_LDADD = \
+  src/processor/logging.o \
+	src/processor/pathname_stripper.o \
+	$(TEST_LIBS) \
+	$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
+src_processor_range_map_shrink_down_unittest_CPPFLAGS = \
+	$(AM_CPPFLAGS) $(TEST_CFLAGS)
+
 src_processor_range_map_unittest_SOURCES = \
 	src/processor/range_map_unittest.cc
 src_processor_range_map_unittest_LDADD = \
 	src/processor/logging.o \
 	src/processor/pathname_stripper.o \
 	$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
 
 src_processor_stackwalker_selftest_SOURCES = \
@@ -1061,141 +1061,105 @@ src_processor_stackwalker_selftest_LDADD
 	src/processor/stackwalker_ppc64.o \
 	src/processor/stackwalker_sparc.o \
 	src/processor/stackwalker_x86.o \
 	src/processor/tokenize.o \
 	$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
 
 src_processor_stackwalker_amd64_unittest_SOURCES = \
 	src/common/test_assembler.cc \
-	src/processor/stackwalker_amd64_unittest.cc \
-	src/testing/gtest/src/gtest-all.cc \
-	src/testing/gtest/src/gtest_main.cc \
-	src/testing/src/gmock-all.cc
+	src/processor/stackwalker_amd64_unittest.cc
 src_processor_stackwalker_amd64_unittest_LDADD = \
 	src/libbreakpad.a \
+	$(TEST_LIBS) \
 	$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
 src_processor_stackwalker_amd64_unittest_CPPFLAGS = \
-	-I$(top_srcdir)/src \
-	-I$(top_srcdir)/src/testing/include \
-	-I$(top_srcdir)/src/testing/gtest/include \
-	-I$(top_srcdir)/src/testing/gtest \
-	-I$(top_srcdir)/src/testing
+	$(AM_CPPFLAGS) $(TEST_CFLAGS)
 
 src_processor_stackwalker_arm_unittest_SOURCES = \
 	src/common/test_assembler.cc \
-	src/processor/stackwalker_arm_unittest.cc \
-	src/testing/gtest/src/gtest-all.cc \
-	src/testing/gtest/src/gtest_main.cc \
-	src/testing/src/gmock-all.cc
+	src/processor/stackwalker_arm_unittest.cc
 src_processor_stackwalker_arm_unittest_LDADD = \
 	src/libbreakpad.a \
+	$(TEST_LIBS) \
 	$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
 src_processor_stackwalker_arm_unittest_CPPFLAGS = \
-	-I$(top_srcdir)/src \
-	-I$(top_srcdir)/src/testing/include \
-	-I$(top_srcdir)/src/testing/gtest/include \
-	-I$(top_srcdir)/src/testing/gtest \
-	-I$(top_srcdir)/src/testing
+	$(AM_CPPFLAGS) $(TEST_CFLAGS)
 
 src_processor_stackwalker_arm64_unittest_SOURCES = \
 	src/common/test_assembler.cc \
-	src/processor/stackwalker_arm64_unittest.cc \
-	src/testing/gtest/src/gtest-all.cc \
-	src/testing/gtest/src/gtest_main.cc \
-	src/testing/src/gmock-all.cc
+	src/processor/stackwalker_arm64_unittest.cc
 src_processor_stackwalker_arm64_unittest_LDADD = \
 	src/libbreakpad.a \
+	$(TEST_LIBS) \
 	$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
 src_processor_stackwalker_arm64_unittest_CPPFLAGS = \
-	-I$(top_srcdir)/src \
-	-I$(top_srcdir)/src/testing/include \
-	-I$(top_srcdir)/src/testing/gtest/include \
-	-I$(top_srcdir)/src/testing/gtest \
-	-I$(top_srcdir)/src/testing
+	$(AM_CPPFLAGS) $(TEST_CFLAGS)
 
 src_processor_stackwalker_address_list_unittest_SOURCES = \
 	src/common/test_assembler.cc \
-	src/processor/stackwalker_address_list_unittest.cc \
-	src/testing/gtest/src/gtest-all.cc \
-	src/testing/gtest/src/gtest_main.cc \
-	src/testing/src/gmock-all.cc
+	src/processor/stackwalker_address_list_unittest.cc
 src_processor_stackwalker_address_list_unittest_LDADD = \
 	src/libbreakpad.a \
+	$(TEST_LIBS) \
 	$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
 src_processor_stackwalker_address_list_unittest_CPPFLAGS = \
-	-I$(top_srcdir)/src \
-	-I$(top_srcdir)/src/testing/include \
-	-I$(top_srcdir)/src/testing/gtest/include \
-	-I$(top_srcdir)/src/testing/gtest \
-	-I$(top_srcdir)/src/testing
+	$(AM_CPPFLAGS) $(TEST_CFLAGS)
 
 src_processor_stackwalker_mips_unittest_SOURCES = \
 	src/common/test_assembler.cc \
-	src/processor/stackwalker_mips_unittest.cc \
-	src/testing/gtest/src/gtest-all.cc \
-	src/testing/gtest/src/gtest_main.cc \
-	src/testing/src/gmock-all.cc
+	src/processor/stackwalker_mips_unittest.cc
 src_processor_stackwalker_mips_unittest_LDADD = \
 	src/libbreakpad.a \
+	$(TEST_LIBS) \
 	$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
 src_processor_stackwalker_mips_unittest_CPPFLAGS = \
-	-I$(top_srcdir)/src \
-	-I$(top_srcdir)/src/testing/include \
-	-I$(top_srcdir)/src/testing/gtest/include \
-	-I$(top_srcdir)/src/testing/gtest \
-	-I$(top_srcdir)/src/testing
+	$(AM_CPPFLAGS) $(TEST_CFLAGS)
+
+src_processor_stackwalker_mips64_unittest_SOURCES = \
+	src/common/test_assembler.cc \
+	src/processor/stackwalker_mips64_unittest.cc
+src_processor_stackwalker_mips64_unittest_LDADD = \
+	src/libbreakpad.a \
+	$(TEST_LIBS) \
+	$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
+src_processor_stackwalker_mips64_unittest_CPPFLAGS = \
+	$(AM_CPPFLAGS) $(TEST_CFLAGS)
 
 src_processor_stackwalker_x86_unittest_SOURCES = \
 	src/common/test_assembler.cc \
-	src/processor/stackwalker_x86_unittest.cc \
-	src/testing/gtest/src/gtest-all.cc \
-	src/testing/gtest/src/gtest_main.cc \
-	src/testing/src/gmock-all.cc
+	src/processor/stackwalker_x86_unittest.cc
 src_processor_stackwalker_x86_unittest_LDADD = \
 	src/libbreakpad.a \
+	$(TEST_LIBS) \
 	$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
 src_processor_stackwalker_x86_unittest_CPPFLAGS = \
-	-I$(top_srcdir)/src \
-	-I$(top_srcdir)/src/testing/include \
-	-I$(top_srcdir)/src/testing/gtest/include \
-	-I$(top_srcdir)/src/testing/gtest \
-	-I$(top_srcdir)/src/testing
+	$(AM_CPPFLAGS) $(TEST_CFLAGS)
 
 src_processor_synth_minidump_unittest_SOURCES = \
 	src/common/test_assembler.cc \
 	src/common/test_assembler.h \
 	src/processor/synth_minidump_unittest.cc \
-	src/testing/gtest/src/gtest-all.cc \
-	src/testing/gtest/src/gtest_main.cc \
-	src/testing/src/gmock-all.cc \
 	src/processor/synth_minidump.cc \
 	src/processor/synth_minidump.h
 src_processor_synth_minidump_unittest_CPPFLAGS = \
-	-I$(top_srcdir)/src \
-	-I$(top_srcdir)/src/testing/include \
-	-I$(top_srcdir)/src/testing/gtest/include \
-	-I$(top_srcdir)/src/testing/gtest \
-	-I$(top_srcdir)/src/testing
-src_processor_synth_minidump_unittest_LDADD = $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
+	$(AM_CPPFLAGS) $(TEST_CFLAGS)
+src_processor_synth_minidump_unittest_LDADD = \
+	$(TEST_LIBS) \
+	$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
 
 src_common_test_assembler_unittest_SOURCES = \
 	src/common/test_assembler.cc \
 	src/common/test_assembler.h \
-	src/common/test_assembler_unittest.cc \
-	src/testing/gtest/src/gtest-all.cc \
-	src/testing/gtest/src/gtest_main.cc \
-	src/testing/src/gmock-all.cc
+	src/common/test_assembler_unittest.cc
 src_common_test_assembler_unittest_CPPFLAGS = \
-	-I$(top_srcdir)/src \
-	-I$(top_srcdir)/src/testing/include \
-	-I$(top_srcdir)/src/testing/gtest/include \
-	-I$(top_srcdir)/src/testing/gtest \
-	-I$(top_srcdir)/src/testing
-src_common_test_assembler_unittest_LDADD = $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
+	$(AM_CPPFLAGS) $(TEST_CFLAGS)
+src_common_test_assembler_unittest_LDADD = \
+	$(TEST_LIBS) \
+	$(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
 
 ## Non-installables
 noinst_PROGRAMS =
 noinst_SCRIPTS = $(check_SCRIPTS)
 
 src_processor_minidump_dump_SOURCES = \
 	src/processor/minidump_dump.cc
 src_processor_minidump_dump_LDADD = \
@@ -1282,125 +1246,238 @@ endif !DISABLE_PROCESSOR
 
 ## Additional files to be included in a source distribution
 ##
 ## find src/client src/common src/processor/testdata src/tools \
 ##     -type f \! -path '*/.svn/*' -print | sort | \
 ##     sed -e s/'^\(.*\)$'/'\t\1 \\'/
 EXTRA_DIST = \
 	$(SCRIPTS) \
-	src/processor/stackwalk_selftest_sol.s \
-	src/client/linux/handler/Makefile \
-	src/client/linux/handler/exception_handler.cc \
-	src/client/linux/handler/exception_handler.h \
-	src/client/linux/handler/minidump_descriptor.cc \
-	src/client/linux/handler/minidump_descriptor.h \
-	src/client/linux/handler/exception_handler_test.cc \
-	src/client/linux/handler/linux_thread.cc \
-	src/client/linux/handler/linux_thread.h \
-	src/client/linux/handler/linux_thread_test.cc \
-	src/client/linux/handler/minidump_generator.cc \
-	src/client/linux/handler/minidump_generator.h \
-	src/client/linux/handler/minidump_test.cc \
+	src/client/linux/data/linux-gate-amd.sym \
+	src/client/linux/data/linux-gate-intel.sym \
+	src/client/mac/handler/breakpad_nlist_64.cc \
+	src/client/mac/handler/breakpad_nlist_64.h \
 	src/client/mac/handler/dynamic_images.cc \
 	src/client/mac/handler/dynamic_images.h \
 	src/client/mac/handler/exception_handler.cc \
 	src/client/mac/handler/exception_handler.h \
-	src/client/mac/handler/exception_handler_test.cc \
+	src/client/mac/handler/mach_vm_compat.h \
 	src/client/mac/handler/minidump_generator.cc \
 	src/client/mac/handler/minidump_generator.h \
-	src/client/mac/handler/minidump_generator_test.cc \
 	src/client/mac/handler/minidump_test.xcodeproj/project.pbxproj \
+	src/client/mac/handler/minidump_tests32-Info.plist \
+	src/client/mac/handler/minidump_tests64-Info.plist \
+	src/client/mac/handler/obj-cTestCases-Info.plist \
 	src/client/mac/handler/protected_memory_allocator.cc \
 	src/client/mac/handler/protected_memory_allocator.h \
-	src/client/minidump_file_writer-inl.h \
-	src/client/minidump_file_writer.cc \
-	src/client/minidump_file_writer.h \
+	src/client/mac/handler/ucontext_compat.h \
+	src/client/mac/handler/testcases/testdata/dump_syms_i386_breakpad.sym \
+	src/client/mac/tests/BreakpadFramework_Test.mm \
+	src/client/mac/tests/crash_generation_server_test.cc \
+	src/client/mac/tests/exception_handler_test.cc \
+	src/client/mac/tests/minidump_generator_test.cc \
+	src/client/mac/tests/minidump_generator_test_helper.cc \
+	src/client/mac/tests/spawn_child_process.h \
+	src/client/mac/tests/testlogging.h \
 	src/client/minidump_file_writer_unittest.cc \
 	src/client/solaris/handler/Makefile \
 	src/client/solaris/handler/exception_handler.cc \
 	src/client/solaris/handler/exception_handler.h \
 	src/client/solaris/handler/exception_handler_test.cc \
 	src/client/solaris/handler/minidump_generator.cc \
 	src/client/solaris/handler/minidump_generator.h \
 	src/client/solaris/handler/minidump_test.cc \
 	src/client/solaris/handler/solaris_lwp.cc \
 	src/client/solaris/handler/solaris_lwp.h \
-	src/client/windows/breakpad_client.sln \
+	src/client/windows/breakpad_client.gyp \
 	src/client/windows/handler/exception_handler.cc \
 	src/client/windows/handler/exception_handler.h \
-	src/client/windows/handler/exception_handler.vcproj \
+	src/client/windows/handler/exception_handler.gyp \
 	src/client/windows/sender/crash_report_sender.cc \
 	src/client/windows/sender/crash_report_sender.h \
-	src/client/windows/sender/crash_report_sender.vcproj \
-	src/common/convert_UTF.c \
-	src/common/convert_UTF.h \
-	src/common/linux/crc32.cc \
-	src/common/linux/dump_symbols.cc \
-	src/common/linux/dump_symbols.h \
-	src/common/linux/elf_symbols_to_module.cc \
-	src/common/linux/elf_symbols_to_module.h \
-	src/common/linux/elfutils.cc \
-	src/common/linux/elfutils.h \
-	src/common/linux/file_id.cc \
-	src/common/linux/file_id.h \
-	src/common/linux/guid_creator.cc \
-	src/common/linux/guid_creator.h \
-	src/common/linux/http_upload.cc \
-	src/common/linux/http_upload.h \
+	src/client/windows/sender/crash_report_sender.gyp \
+	src/common/dwarf/dwarf2diehandler.h \
+	src/common/dwarf/dwarf2enums.h \
+	src/common/dwarf/line_state_machine.h \
+	src/common/dwarf/types.h \
+	src/common/mac/arch_utilities.h \
+	src/common/mac/byteswap.h \
 	src/common/mac/HTTPMultipartUpload.h \
 	src/common/mac/HTTPMultipartUpload.m \
-	src/common/mac/dump_syms.h \
-	src/common/mac/dump_syms.cc \
-	src/common/mac/file_id.cc \
-	src/common/mac/file_id.h \
-	src/common/mac/macho_id.cc \
-	src/common/mac/macho_id.h \
-	src/common/mac/macho_utilities.cc \
-	src/common/mac/macho_utilities.h \
-	src/common/mac/macho_walker.cc \
-	src/common/mac/macho_walker.h \
 	src/common/mac/string_utilities.cc \
 	src/common/mac/string_utilities.h \
-	src/common/md5.cc \
-	src/common/md5.h \
+	src/common/mac/super_fat_arch.h \
 	src/common/scoped_ptr.h \
 	src/common/solaris/dump_symbols.cc \
 	src/common/solaris/dump_symbols.h \
 	src/common/solaris/file_id.cc \
 	src/common/solaris/file_id.h \
 	src/common/solaris/guid_creator.cc \
 	src/common/solaris/guid_creator.h \
 	src/common/solaris/message_output.h \
-	src/common/string_conversion.cc \
-	src/common/string_conversion.h \
 	src/common/windows/guid_string.cc \
 	src/common/windows/guid_string.h \
 	src/common/windows/http_upload.cc \
 	src/common/windows/http_upload.h \
 	src/common/windows/pdb_source_line_writer.cc \
 	src/common/windows/pdb_source_line_writer.h \
 	src/common/windows/string_utils-inl.h \
 	src/common/windows/string_utils.cc \
+	src/processor/stackwalk_common.cc \
+	src/processor/stackwalk_common.h \
+	src/processor/stackwalker_selftest_sol.s \
+	src/processor/testdata/ascii_read_av_block_write.dmp \
+	src/processor/testdata/ascii_read_av_clobber_write.dmp \
+	src/processor/testdata/ascii_read_av_conditional.dmp \
+	src/processor/testdata/ascii_read_av.dmp \
+	src/processor/testdata/ascii_read_av_then_jmp.dmp \
+	src/processor/testdata/ascii_read_av_xchg_write.dmp \
+	src/processor/testdata/ascii_write_av_arg_to_call.dmp \
+	src/processor/testdata/ascii_write_av.dmp \
+	src/processor/testdata/exec_av_on_stack.dmp \
+	src/processor/testdata/linux_divide_by_zero.dmp \
+	src/processor/testdata/linux_executable_heap.dmp \
+	src/processor/testdata/linux_executable_stack.dmp \
+	src/processor/testdata/linux_inside_module_exe_region1.dmp \
+	src/processor/testdata/linux_inside_module_exe_region2.dmp \
+	src/processor/testdata/linux_jmp_to_0.dmp \
+	src/processor/testdata/linux_jmp_to_module_not_exe_region.dmp \
+	src/processor/testdata/linux_null_dereference.dmp \
+	src/processor/testdata/linux_null_read_av.dmp \
+	src/processor/testdata/linux_outside_module.dmp \
+	src/processor/testdata/linux_overflow.dmp \
+	src/processor/testdata/linux_raise_sigabrt.dmp \
+	src/processor/testdata/linux_stack_pointer_in_module.dmp \
+	src/processor/testdata/linux_stack_pointer_in_stack.dmp \
+	src/processor/testdata/linux_stacksmash.dmp \
+	src/processor/testdata/linux_write_to_nonwritable_module.dmp \
+	src/processor/testdata/linux_write_to_nonwritable_region_math.dmp \
+	src/processor/testdata/linux_write_to_outside_module.dmp \
+	src/processor/testdata/linux_write_to_outside_module_via_math.dmp \
+	src/processor/testdata/linux_write_to_under_4k.dmp \
+	src/processor/testdata/microdump-arm64.dmp \
+	src/processor/testdata/microdump-arm.dmp \
+	src/processor/testdata/microdump-mips32.dmp \
+	src/processor/testdata/microdump-mips64.dmp \
+	src/processor/testdata/microdump-multiple.dmp \
+	src/processor/testdata/microdump.stackwalk-arm64.out \
+	src/processor/testdata/microdump.stackwalk-arm.out \
+	src/processor/testdata/microdump.stackwalk.machine_readable-arm64.out \
+	src/processor/testdata/microdump.stackwalk.machine_readable-arm.out \
+	src/processor/testdata/microdump-x86.dmp \
 	src/processor/testdata/minidump2.dmp \
 	src/processor/testdata/minidump2.dump.out \
 	src/processor/testdata/minidump2.stackwalk.machine_readable.out \
 	src/processor/testdata/minidump2.stackwalk.out \
+	src/processor/testdata/module0.out \
 	src/processor/testdata/module1.out \
 	src/processor/testdata/module2.out \
 	src/processor/testdata/module3_bad.out \
 	src/processor/testdata/module4_bad.out \
+	src/processor/testdata/null_read_av.dmp \
+	src/processor/testdata/null_write_av.dmp \
+	src/processor/testdata/read_av_clobber_write.dmp \
+	src/processor/testdata/read_av_conditional.dmp \
+	src/processor/testdata/read_av_non_null.dmp \
+	src/processor/testdata/stack_exhaustion.dmp \
+	src/processor/testdata/write_av_non_null.dmp \
 	src/processor/testdata/symbols/kernel32.pdb/BCE8785C57B44245A669896B6A19B9542/kernel32.sym \
+	src/processor/testdata/symbols/ld-2.13.so/C32AD7E235EA6112E02A5B9D6219C4850/ld-2.13.so.sym \
+	src/processor/testdata/symbols/libc-2.13.so/F4F8DFCD5A5FB5A7CE64717E9E6AE3890/libc-2.13.so.sym \
+	src/processor/testdata/symbols/libgcc_s.so.1/18B180F90887D8F8B5C35D185444AF4C0/libgcc_s.so.1.sym \
+	src/processor/testdata/symbols/microdump/breakpad_unittests/D6D1FEC9A15DE7F38A236898871A2E770/breakpad_unittests.sym \
+	src/processor/testdata/symbols/microdump/breakpad_unittests/DA7778FB66018A4E9B4110ED06E730D00/breakpad_unittests.sym \
+	src/processor/testdata/symbols/microdump/crash_example/6E72E2F1A5F59AB3D51356FDFE394D490/crash_example.sym \
+	src/processor/testdata/symbols/microdump/crash_example/8F36148CC4647A8116CAF2A25F591F570/crash_example.sym \
+	src/processor/testdata/symbols/null_read_av/7B7D1968FF0D47AE4366E9C3A7E1B6750/null_read_av.sym \
+	src/processor/testdata/symbols/overflow/B0E1FC01EF48E39CAF5C881D2DF0C3840/overflow.sym \
 	src/processor/testdata/symbols/test_app.pdb/5A9832E5287241C1838ED98914E9B7FF1/test_app.sym \
 	src/processor/testdata/test_app.cc \
-	src/tools/linux/dump_syms/Makefile \
-	src/tools/linux/dump_syms/dump_syms.cc \
-	src/tools/linux/symupload/Makefile \
-	src/tools/linux/symupload/minidump_upload.cc \
-	src/tools/linux/symupload/sym_upload.cc \
+	src/testing/gtest/include/gtest/gtest.h \
+	src/testing/gtest/include/gtest/gtest-death-test.h \
+	src/testing/gtest/include/gtest/gtest-message.h \
+	src/testing/gtest/include/gtest/gtest-param-test.h \
+	src/testing/gtest/include/gtest/gtest-printers.h \
+	src/testing/gtest/include/gtest/gtest-spi.h \
+	src/testing/gtest/include/gtest/gtest-test-part.h \
+	src/testing/gtest/include/gtest/gtest-typed-test.h \
+	src/testing/gtest/include/gtest/gtest_pred_impl.h \
+	src/testing/gtest/include/gtest/gtest_prod.h \
+	src/testing/gtest/include/gtest/internal/gtest-death-test-internal.h \
+	src/testing/gtest/include/gtest/internal/gtest-filepath.h \
+	src/testing/gtest/include/gtest/internal/gtest-internal.h \
+	src/testing/gtest/include/gtest/internal/gtest-linked_ptr.h \
+	src/testing/gtest/include/gtest/internal/gtest-param-util-generated.h \
+	src/testing/gtest/include/gtest/internal/gtest-param-util.h \
+	src/testing/gtest/include/gtest/internal/gtest-port.h \
+	src/testing/gtest/include/gtest/internal/gtest-string.h \
+	src/testing/gtest/include/gtest/internal/gtest-tuple.h \
+	src/testing/gtest/include/gtest/internal/gtest-type-util.h \
+	src/testing/gtest/src/gtest.cc \
+	src/testing/gtest/src/gtest-death-test.cc \
+	src/testing/gtest/src/gtest-filepath.cc \
+	src/testing/gtest/src/gtest-internal-inl.h \
+	src/testing/gtest/src/gtest-port.cc \
+	src/testing/gtest/src/gtest-printers.cc \
+	src/testing/gtest/src/gtest-test-part.cc \
+	src/testing/gtest/src/gtest-typed-test.cc \
+	src/testing/include/gmock/gmock.h \
+	src/testing/include/gmock/gmock-actions.h \
+	src/testing/include/gmock/gmock-cardinalities.h \
+	src/testing/include/gmock/gmock-generated-actions.h \
+	src/testing/include/gmock/gmock-generated-function-mockers.h \
+	src/testing/include/gmock/gmock-generated-matchers.h \
+	src/testing/include/gmock/gmock-generated-nice-strict.h \
+	src/testing/include/gmock/gmock-matchers.h \
+	src/testing/include/gmock/gmock-more-actions.h \
+	src/testing/include/gmock/gmock-more-matchers.h \
+	src/testing/include/gmock/gmock-spec-builders.h \
+	src/testing/include/gmock/internal/gmock-generated-internal-utils.h \
+	src/testing/include/gmock/internal/gmock-internal-utils.h \
+	src/testing/include/gmock/internal/gmock-port.h \
+	src/testing/src/gmock.cc \
+	src/testing/src/gmock-cardinalities.cc \
+	src/testing/src/gmock-internal-utils.cc \
+	src/testing/src/gmock-matchers.cc \
+	src/testing/src/gmock-spec-builders.cc \
+	src/testing/src/gmock_main.cc \
+	src/third_party/curl/COPYING \
+	src/third_party/curl/curlbuild.h \
+	src/third_party/curl/curl.h \
+	src/third_party/curl/curlrules.h \
+	src/third_party/curl/curlver.h \
+	src/third_party/curl/easy.h \
+	src/third_party/curl/mprintf.h \
+	src/third_party/curl/multi.h \
+	src/third_party/curl/stdcheaders.h \
+	src/third_party/curl/typecheck-gcc.h \
+	src/third_party/curl/types.h \
+	src/third_party/mac_headers/architecture/byte_order.h \
+	src/third_party/mac_headers/i386/_types.h \
+	src/third_party/mac_headers/mach/boolean.h \
+	src/third_party/mac_headers/mach/i386/boolean.h \
+	src/third_party/mac_headers/mach/i386/vm_param.h \
+	src/third_party/mac_headers/mach/i386/vm_types.h \
+	src/third_party/mac_headers/mach/machine/boolean.h \
+	src/third_party/mac_headers/mach/machine.h \
+	src/third_party/mac_headers/mach/machine/thread_state.h \
+	src/third_party/mac_headers/mach/machine/thread_status.h \
+	src/third_party/mac_headers/mach/machine/vm_types.h \
+	src/third_party/mac_headers/mach-o/arch.h \
+	src/third_party/mac_headers/mach-o/fat.h \
+	src/third_party/mac_headers/mach-o/loader.h \
+	src/third_party/mac_headers/mach-o/nlist.h \
+	src/third_party/mac_headers/mach/thread_status.h \
+	src/third_party/mac_headers/mach/vm_prot.h \
+	src/third_party/mac_headers/README \
+	src/third_party/musl/README \
+	src/third_party/musl/COPYRIGHT \
+	src/third_party/musl/README.breakpad \
+	src/third_party/musl/VERSION \
+	src/third_party/musl/include/elf.h \
 	src/tools/mac/crash_report/crash_report.mm \
 	src/tools/mac/crash_report/crash_report.xcodeproj/project.pbxproj \
 	src/tools/mac/crash_report/on_demand_symbol_supplier.h \
 	src/tools/mac/crash_report/on_demand_symbol_supplier.mm \
 	src/tools/mac/dump_syms/dump_syms.xcodeproj/project.pbxproj \
 	src/tools/mac/dump_syms/dump_syms_tool.cc \
 	src/tools/mac/symupload/minidump_upload.m \
 	src/tools/mac/symupload/symupload.m \
@@ -1409,17 +1486,25 @@ EXTRA_DIST = \
 	src/tools/solaris/dump_syms/dump_syms.cc \
 	src/tools/solaris/dump_syms/run_regtest.sh \
 	src/tools/solaris/dump_syms/testdata/dump_syms_regtest.cc \
 	src/tools/solaris/dump_syms/testdata/dump_syms_regtest.o \
 	src/tools/solaris/dump_syms/testdata/dump_syms_regtest.stabs \
 	src/tools/solaris/dump_syms/testdata/dump_syms_regtest.sym \
 	src/tools/windows/converter/ms_symbol_server_converter.cc \
 	src/tools/windows/converter/ms_symbol_server_converter.h \
-	src/tools/windows/converter/ms_symbol_server_converter.vcproj \
+	src/tools/windows/converter/ms_symbol_server_converter.gyp \
 	src/tools/windows/dump_syms/dump_syms.cc \
-	src/tools/windows/dump_syms/dump_syms.vcproj \
+	src/tools/windows/dump_syms/dump_syms.gyp \
 	src/tools/windows/dump_syms/run_regtest.sh \
 	src/tools/windows/dump_syms/testdata/dump_syms_regtest.cc \
 	src/tools/windows/dump_syms/testdata/dump_syms_regtest.pdb \
 	src/tools/windows/dump_syms/testdata/dump_syms_regtest.sym \
+	src/tools/windows/dump_syms/testdata/dump_syms_regtest64.sym \
+	src/tools/windows/dump_syms/testdata/omap_reorder_bbs.sym \
+	src/tools/windows/dump_syms/testdata/omap_reorder_funcs.sym \
+	src/tools/windows/dump_syms/testdata/omap_stretched.sym \
+	src/tools/windows/dump_syms/testdata/omap_stretched_filled.sym \
 	src/tools/windows/symupload/symupload.cc \
-	src/tools/windows/symupload/symupload.vcproj
+	src/tools/windows/symupload/symupload.gyp
+
+mostlyclean-local:
+	-find src -name '*.dwo' -exec rm -f {} +
--- a/toolkit/crashreporter/google-breakpad/Makefile.in
+++ b/toolkit/crashreporter/google-breakpad/Makefile.in
@@ -1,25 +1,25 @@
-# Makefile.in generated by automake 1.10 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 # PARTICULAR PURPOSE.
 
 @SET_MAKE@
 
-# Copyright (c) 2006, Google Inc.
+# Copyright (c) 2011, Google Inc.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions are
 # met:
 #
 #     * Redistributions of source code must retain the above copyright
 # notice, this list of conditions and the following disclaimer.
@@ -41,311 +41,1938 @@
 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
 
 
+
 VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
 pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
 install_sh_DATA = $(install_sh) -c -m 644
 install_sh_PROGRAM = $(install_sh) -c
 install_sh_SCRIPT = $(install_sh) -c
 INSTALL_HEADER = $(INSTALL_DATA)
 transform = $(program_transform_name)
 NORMAL_INSTALL = :
 PRE_INSTALL = :
 POST_INSTALL = :
 NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
-bin_PROGRAMS = src/processor/minidump_dump$(EXEEXT) \
-	src/processor/minidump_stackwalk$(EXEEXT)
-check_PROGRAMS = src/processor/address_map_unittest$(EXEEXT) \
-	src/processor/basic_source_line_resolver_unittest$(EXEEXT) \
-	src/processor/contained_range_map_unittest$(EXEEXT) \
-	src/processor/minidump_processor_unittest$(EXEEXT) \
-	src/processor/pathname_stripper_unittest$(EXEEXT) \
-	src/processor/postfix_evaluator_unittest$(EXEEXT) \
-	src/processor/range_map_unittest$(EXEEXT) $(am__EXEEXT_1)
-@SELFTEST_TRUE@am__append_1 = \
-@SELFTEST_TRUE@	src/processor/stackwalker_selftest
+
+# This allows using fixed NDK headers when building for Android.
+# This is only necessary for building the unit tests until GTest is upgraded
+# to a future version.
+@ANDROID_HOST_TRUE@am__append_1 =  \
+@ANDROID_HOST_TRUE@	-I$(top_srcdir)/src/common/android/include \
+@ANDROID_HOST_TRUE@	-I$(top_srcdir)/src/common/android/testing/include
+
+# These are good warnings to be treated as errors
+@GCC_TRUE@am__append_2 = \
+@GCC_TRUE@	-Werror=missing-braces \
+@GCC_TRUE@	-Werror=non-virtual-dtor \
+@GCC_TRUE@	-Werror=overloaded-virtual \
+@GCC_TRUE@	-Werror=reorder \
+@GCC_TRUE@	-Werror=sign-compare \
+@GCC_TRUE@	-Werror=unused-variable \
+@GCC_TRUE@	-Werror=vla
+
+
+# Build as PIC on Linux, for linux_client_unittest_shlib
+@LINUX_HOST_TRUE@am__append_3 = -fPIC
+@LINUX_HOST_TRUE@am__append_4 = -fPIC
+bin_PROGRAMS = $(am__EXEEXT_2) $(am__EXEEXT_3) $(am__EXEEXT_4)
+check_PROGRAMS = $(am__EXEEXT_5) $(am__EXEEXT_6) $(am__EXEEXT_7) \
+	$(am__EXEEXT_8) $(am__EXEEXT_9)
+EXTRA_PROGRAMS = $(am__EXEEXT_1)
+@DISABLE_PROCESSOR_FALSE@am__append_5 = src/libbreakpad.a
+@DISABLE_PROCESSOR_FALSE@am__append_6 = breakpad.pc
+@DISABLE_PROCESSOR_FALSE@am__append_7 = src/third_party/libdisasm/libdisasm.a
+@LINUX_HOST_TRUE@am__append_8 = src/client/linux/libbreakpad_client.a
+@LINUX_HOST_TRUE@am__append_9 = breakpad-client.pc
+@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@am__append_10 = \
+@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@	src/common/android/breakpad_getcontext.S
+
+@DISABLE_PROCESSOR_FALSE@am__append_11 = \
+@DISABLE_PROCESSOR_FALSE@	src/processor/microdump_stackwalk \
+@DISABLE_PROCESSOR_FALSE@	src/processor/minidump_dump \
+@DISABLE_PROCESSOR_FALSE@	src/processor/minidump_stackwalk
+
+@LINUX_HOST_TRUE@am__append_12 = src/client/linux/linux_dumper_unittest_helper \
+@LINUX_HOST_TRUE@	src/client/linux/linux_client_unittest_shlib
+@LINUX_HOST_TRUE@am__append_13 = src/client/linux/linux_dumper_unittest_helper \
+@LINUX_HOST_TRUE@	src/client/linux/linux_client_unittest_shlib
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am__append_14 = \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/tools/linux/core2md/core2md \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/tools/linux/dump_syms/dump_syms \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/tools/linux/md2core/minidump-2-core \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/tools/linux/symupload/minidump_upload \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/tools/linux/symupload/sym_upload
+
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@am__append_15 = \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@	src/tools/mac/dump_syms/dump_syms_mac
+
+@DISABLE_PROCESSOR_FALSE@am__append_16 = \
+@DISABLE_PROCESSOR_FALSE@	src/common/test_assembler_unittest \
+@DISABLE_PROCESSOR_FALSE@	src/processor/address_map_unittest \
+@DISABLE_PROCESSOR_FALSE@	src/processor/basic_source_line_resolver_unittest \
+@DISABLE_PROCESSOR_FALSE@	src/processor/cfi_frame_info_unittest \
+@DISABLE_PROCESSOR_FALSE@	src/processor/contained_range_map_unittest \
+@DISABLE_PROCESSOR_FALSE@	src/processor/disassembler_x86_unittest \
+@DISABLE_PROCESSOR_FALSE@	src/processor/exploitability_unittest \
+@DISABLE_PROCESSOR_FALSE@	src/processor/fast_source_line_resolver_unittest \
+@DISABLE_PROCESSOR_FALSE@	src/processor/map_serializers_unittest \
+@DISABLE_PROCESSOR_FALSE@	src/processor/microdump_processor_unittest \
+@DISABLE_PROCESSOR_FALSE@	src/processor/minidump_processor_unittest \
+@DISABLE_PROCESSOR_FALSE@	src/processor/minidump_unittest \
+@DISABLE_PROCESSOR_FALSE@	src/processor/static_address_map_unittest \
+@DISABLE_PROCESSOR_FALSE@	src/processor/static_contained_range_map_unittest \
+@DISABLE_PROCESSOR_FALSE@	src/processor/static_map_unittest \
+@DISABLE_PROCESSOR_FALSE@	src/processor/static_range_map_unittest \
+@DISABLE_PROCESSOR_FALSE@	src/processor/pathname_stripper_unittest \
+@DISABLE_PROCESSOR_FALSE@	src/processor/postfix_evaluator_unittest \
+@DISABLE_PROCESSOR_FALSE@	src/processor/proc_maps_linux_unittest \
+@DISABLE_PROCESSOR_FALSE@	src/processor/range_map_shrink_down_unittest \
+@DISABLE_PROCESSOR_FALSE@	src/processor/range_map_unittest \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_amd64_unittest \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_arm_unittest \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_arm64_unittest \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_address_list_unittest \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_mips_unittest \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_mips64_unittest \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_x86_unittest \
+@DISABLE_PROCESSOR_FALSE@	src/processor/synth_minidump_unittest
+
+@LINUX_HOST_TRUE@am__append_17 = \
+@LINUX_HOST_TRUE@	src/client/linux/linux_client_unittest
+
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am__append_18 = \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/dumper_unittest \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/tools/linux/md2core/minidump_2_core_unittest
+
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@am__append_19 = \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@	src/common/mac/macho_reader_unittest
+
+@DISABLE_PROCESSOR_FALSE@@SELFTEST_TRUE@am__append_20 = \
+@DISABLE_PROCESSOR_FALSE@@SELFTEST_TRUE@	src/processor/stackwalker_selftest
+
+@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@am__append_21 = \
+@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@	src/common/android/breakpad_getcontext.S
+
+@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@am__append_22 = \
+@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@	src/common/android/breakpad_getcontext_unittest.cc
+
+@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@am__append_23 = \
+@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@	-llog -lm
+
+@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@am__append_24 = \
+@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@        -llog
 
 noinst_PROGRAMS =
 subdir = .
-DIST_COMMON = README $(am__configure_deps) $(dist_doc_DATA) \
-	$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
-	$(top_srcdir)/configure $(top_srcdir)/src/config.h.in AUTHORS \
-	COPYING ChangeLog INSTALL NEWS autotools/config.guess \
-	autotools/config.sub autotools/depcomp autotools/install-sh \
-	autotools/ltmain.sh autotools/missing
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \
+	$(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
+	$(am__configure_deps) $(dist_doc_DATA) $(includec_HEADERS) \
+	$(am__includecl_HEADERS_DIST) $(am__includeclc_HEADERS_DIST) \
+	$(am__includecldwc_HEADERS_DIST) \
+	$(am__includeclh_HEADERS_DIST) $(am__includeclm_HEADERS_DIST) \
+	$(includegbc_HEADERS) $(am__includelss_HEADERS_DIST) \
+	$(includep_HEADERS) $(am__DIST_COMMON)
 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
  configure.lineno config.status.lineno
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/src/config.h
-CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_FILES = breakpad.pc breakpad-client.pc
+CONFIG_CLEAN_VPATH_FILES =
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
     *) f=$$p;; \
   esac;
-am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
 am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \
-	"$(DESTDIR)$(docdir)"
-libLTLIBRARIES_INSTALL = $(INSTALL)
-LTLIBRARIES = $(lib_LTLIBRARIES)
-src_libbreakpad_la_LIBADD =
+	"$(DESTDIR)$(docdir)" "$(DESTDIR)$(pkgconfigdir)" \
+	"$(DESTDIR)$(includecdir)" "$(DESTDIR)$(includecldir)" \
+	"$(DESTDIR)$(includeclcdir)" "$(DESTDIR)$(includecldwcdir)" \
+	"$(DESTDIR)$(includeclhdir)" "$(DESTDIR)$(includeclmdir)" \
+	"$(DESTDIR)$(includegbcdir)" "$(DESTDIR)$(includelssdir)" \
+	"$(DESTDIR)$(includepdir)"
+LIBRARIES = $(lib_LIBRARIES) $(noinst_LIBRARIES)
+ARFLAGS = cru
+AM_V_AR = $(am__v_AR_@AM_V@)
+am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)
+am__v_AR_0 = @echo "  AR      " $@;
+am__v_AR_1 = 
+src_client_linux_libbreakpad_client_a_AR = $(AR) $(ARFLAGS)
+src_client_linux_libbreakpad_client_a_LIBADD =
+am__src_client_linux_libbreakpad_client_a_SOURCES_DIST =  \
+	src/client/linux/crash_generation/crash_generation_client.cc \
+	src/client/linux/crash_generation/crash_generation_server.cc \
+	src/client/linux/dump_writer_common/thread_info.cc \
+	src/client/linux/dump_writer_common/ucontext_reader.cc \
+	src/client/linux/handler/exception_handler.cc \
+	src/client/linux/handler/exception_handler.h \
+	src/client/linux/handler/minidump_descriptor.cc \
+	src/client/linux/handler/minidump_descriptor.h \
+	src/client/linux/log/log.cc src/client/linux/log/log.h \
+	src/client/linux/microdump_writer/microdump_writer.cc \
+	src/client/linux/microdump_writer/microdump_writer.h \
+	src/client/linux/minidump_writer/linux_core_dumper.cc \
+	src/client/linux/minidump_writer/linux_dumper.cc \
+	src/client/linux/minidump_writer/linux_ptrace_dumper.cc \
+	src/client/linux/minidump_writer/minidump_writer.cc \
+	src/client/minidump_file_writer-inl.h \
+	src/client/minidump_file_writer.cc \
+	src/client/minidump_file_writer.h src/common/convert_UTF.c \
+	src/common/convert_UTF.h src/common/md5.cc src/common/md5.h \
+	src/common/string_conversion.cc src/common/string_conversion.h \
+	src/common/linux/elf_core_dump.cc src/common/linux/elfutils.cc \
+	src/common/linux/elfutils.h src/common/linux/file_id.cc \
+	src/common/linux/file_id.h src/common/linux/guid_creator.cc \
+	src/common/linux/guid_creator.h \
+	src/common/linux/linux_libc_support.cc \
+	src/common/linux/memory_mapped_file.cc \
+	src/common/linux/safe_readlink.cc \
+	src/common/android/breakpad_getcontext.S
 am__dirstamp = $(am__leading_dot)dirstamp
-am_src_libbreakpad_la_OBJECTS = src/processor/basic_code_modules.lo \
-	src/processor/basic_source_line_resolver.lo \
-	src/processor/call_stack.lo src/processor/logging.lo \
-	src/processor/minidump.lo src/processor/minidump_processor.lo \
-	src/processor/pathname_stripper.lo \
-	src/processor/process_state.lo \
-	src/processor/simple_symbol_supplier.lo \
-	src/processor/stackwalker.lo \
-	src/processor/stackwalker_amd64.lo \
-	src/processor/stackwalker_ppc.lo \
-	src/processor/stackwalker_sparc.lo \
-	src/processor/stackwalker_x86.lo
-src_libbreakpad_la_OBJECTS = $(am_src_libbreakpad_la_OBJECTS)
-binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
-@SELFTEST_TRUE@am__EXEEXT_1 =  \
-@SELFTEST_TRUE@	src/processor/stackwalker_selftest$(EXEEXT)
+@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@am__objects_1 = src/common/android/breakpad_getcontext.$(OBJEXT)
+@LINUX_HOST_TRUE@am_src_client_linux_libbreakpad_client_a_OBJECTS = src/client/linux/crash_generation/crash_generation_client.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/client/linux/crash_generation/crash_generation_server.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/client/linux/dump_writer_common/thread_info.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/client/linux/dump_writer_common/ucontext_reader.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/client/linux/handler/exception_handler.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/client/linux/handler/minidump_descriptor.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/client/linux/log/log.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/client/linux/microdump_writer/microdump_writer.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/client/linux/minidump_writer/linux_core_dumper.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/client/linux/minidump_writer/linux_dumper.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/client/linux/minidump_writer/linux_ptrace_dumper.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/client/linux/minidump_writer/minidump_writer.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/client/minidump_file_writer.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/common/convert_UTF.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/common/md5.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/common/string_conversion.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/common/linux/elf_core_dump.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/common/linux/elfutils.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/common/linux/file_id.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/common/linux/guid_creator.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/common/linux/linux_libc_support.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/common/linux/memory_mapped_file.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/common/linux/safe_readlink.$(OBJEXT) \
+@LINUX_HOST_TRUE@	$(am__objects_1)
+src_client_linux_libbreakpad_client_a_OBJECTS =  \
+	$(am_src_client_linux_libbreakpad_client_a_OBJECTS)
+src_libbreakpad_a_AR = $(AR) $(ARFLAGS)
+src_libbreakpad_a_LIBADD =
+am__src_libbreakpad_a_SOURCES_DIST =  \
+	src/google_breakpad/common/breakpad_types.h \
+	src/google_breakpad/common/minidump_format.h \
+	src/google_breakpad/common/minidump_size.h \
+	src/google_breakpad/processor/basic_source_line_resolver.h \
+	src/google_breakpad/processor/call_stack.h \
+	src/google_breakpad/processor/code_module.h \
+	src/google_breakpad/processor/code_modules.h \
+	src/google_breakpad/processor/dump_context.h \
+	src/google_breakpad/processor/dump_object.h \
+	src/google_breakpad/processor/exploitability.h \
+	src/google_breakpad/processor/fast_source_line_resolver.h \
+	src/google_breakpad/processor/memory_region.h \
+	src/google_breakpad/processor/microdump.h \
+	src/google_breakpad/processor/microdump_processor.h \
+	src/google_breakpad/processor/minidump.h \
+	src/google_breakpad/processor/minidump_processor.h \
+	src/google_breakpad/processor/process_result.h \
+	src/google_breakpad/processor/process_state.h \
+	src/google_breakpad/processor/proc_maps_linux.h \
+	src/google_breakpad/processor/source_line_resolver_base.h \
+	src/google_breakpad/processor/source_line_resolver_interface.h \
+	src/google_breakpad/processor/stack_frame.h \
+	src/google_breakpad/processor/stack_frame_cpu.h \
+	src/google_breakpad/processor/stack_frame_symbolizer.h \
+	src/google_breakpad/processor/stackwalker.h \
+	src/google_breakpad/processor/symbol_supplier.h \
+	src/google_breakpad/processor/system_info.h \
+	src/processor/address_map-inl.h src/processor/address_map.h \
+	src/processor/basic_code_module.h \
+	src/processor/basic_code_modules.cc \
+	src/processor/basic_code_modules.h \
+	src/processor/basic_source_line_resolver_types.h \
+	src/processor/basic_source_line_resolver.cc \
+	src/processor/call_stack.cc src/processor/cfi_frame_info.cc \
+	src/processor/cfi_frame_info.h \
+	src/processor/contained_range_map-inl.h \
+	src/processor/contained_range_map.h \
+	src/processor/disassembler_x86.h \
+	src/processor/disassembler_x86.cc \
+	src/processor/dump_context.cc src/processor/dump_object.cc \
+	src/processor/exploitability.cc \
+	src/processor/exploitability_linux.h \
+	src/processor/exploitability_linux.cc \
+	src/processor/exploitability_win.h \
+	src/processor/exploitability_win.cc \
+	src/processor/fast_source_line_resolver_types.h \
+	src/processor/fast_source_line_resolver.cc \
+	src/processor/linked_ptr.h src/processor/logging.h \
+	src/processor/logging.cc src/processor/map_serializers-inl.h \
+	src/processor/map_serializers.h src/processor/microdump.cc \
+	src/processor/microdump_processor.cc src/processor/minidump.cc \
+	src/processor/minidump_processor.cc \
+	src/processor/module_comparer.cc \
+	src/processor/module_comparer.h src/processor/module_factory.h \
+	src/processor/module_serializer.cc \
+	src/processor/module_serializer.h \
+	src/processor/pathname_stripper.cc \
+	src/processor/pathname_stripper.h \
+	src/processor/postfix_evaluator-inl.h \
+	src/processor/postfix_evaluator.h \
+	src/processor/process_state.cc \
+	src/processor/proc_maps_linux.cc src/processor/range_map-inl.h \
+	src/processor/range_map.h \
+	src/processor/simple_serializer-inl.h \
+	src/processor/simple_serializer.h \
+	src/processor/simple_symbol_supplier.cc \
+	src/processor/simple_symbol_supplier.h \
+	src/processor/windows_frame_info.h \
+	src/processor/source_line_resolver_base_types.h \
+	src/processor/source_line_resolver_base.cc \
+	src/processor/stack_frame_cpu.cc \
+	src/processor/stack_frame_symbolizer.cc \
+	src/processor/stackwalker.cc \
+	src/processor/stackwalker_amd64.cc \
+	src/processor/stackwalker_amd64.h \
+	src/processor/stackwalker_arm.cc \
+	src/processor/stackwalker_arm.h \
+	src/processor/stackwalker_arm64.cc \
+	src/processor/stackwalker_arm64.h \
+	src/processor/stackwalker_address_list.cc \
+	src/processor/stackwalker_address_list.h \
+	src/processor/stackwalker_mips.cc \
+	src/processor/stackwalker_mips.h \
+	src/processor/stackwalker_ppc.cc \
+	src/processor/stackwalker_ppc.h \
+	src/processor/stackwalker_ppc64.cc \
+	src/processor/stackwalker_ppc64.h \
+	src/processor/stackwalker_sparc.cc \
+	src/processor/stackwalker_sparc.h \
+	src/processor/stackwalker_x86.cc \
+	src/processor/stackwalker_x86.h \
+	src/processor/static_address_map-inl.h \
+	src/processor/static_address_map.h \
+	src/processor/static_contained_range_map-inl.h \
+	src/processor/static_contained_range_map.h \
+	src/processor/static_map_iterator-inl.h \
+	src/processor/static_map_iterator.h \
+	src/processor/static_map-inl.h src/processor/static_map.h \
+	src/processor/static_range_map-inl.h \
+	src/processor/static_range_map.h \
+	src/processor/symbolic_constants_win.cc \
+	src/processor/symbolic_constants_win.h \
+	src/processor/tokenize.cc src/processor/tokenize.h
+@DISABLE_PROCESSOR_FALSE@am_src_libbreakpad_a_OBJECTS = src/processor/basic_code_modules.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/basic_source_line_resolver.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/call_stack.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/cfi_frame_info.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/disassembler_x86.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/dump_context.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/dump_object.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/exploitability.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/exploitability_linux.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/exploitability_win.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/fast_source_line_resolver.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/logging.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/microdump.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/microdump_processor.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/minidump.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/minidump_processor.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/module_comparer.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/module_serializer.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/pathname_stripper.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/process_state.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/proc_maps_linux.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/simple_symbol_supplier.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/source_line_resolver_base.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stack_frame_cpu.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stack_frame_symbolizer.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_amd64.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_arm.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_arm64.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_address_list.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_mips.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_ppc.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_ppc64.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_sparc.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_x86.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/symbolic_constants_win.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/tokenize.$(OBJEXT)
+src_libbreakpad_a_OBJECTS = $(am_src_libbreakpad_a_OBJECTS)
+src_testing_libtesting_a_AR = $(AR) $(ARFLAGS)
+src_testing_libtesting_a_LIBADD =
+am__src_testing_libtesting_a_SOURCES_DIST =  \
+	src/breakpad_googletest_includes.h \
+	src/testing/gtest/src/gtest-all.cc \
+	src/testing/gtest/src/gtest_main.cc \
+	src/testing/src/gmock-all.cc
+@SYSTEM_TEST_LIBS_FALSE@am_src_testing_libtesting_a_OBJECTS = src/testing/gtest/src/src_testing_libtesting_a-gtest-all.$(OBJEXT) \
+@SYSTEM_TEST_LIBS_FALSE@	src/testing/gtest/src/src_testing_libtesting_a-gtest_main.$(OBJEXT) \
+@SYSTEM_TEST_LIBS_FALSE@	src/testing/src/src_testing_libtesting_a-gmock-all.$(OBJEXT)
+src_testing_libtesting_a_OBJECTS =  \
+	$(am_src_testing_libtesting_a_OBJECTS)
+src_third_party_libdisasm_libdisasm_a_AR = $(AR) $(ARFLAGS)
+src_third_party_libdisasm_libdisasm_a_LIBADD =
+am__src_third_party_libdisasm_libdisasm_a_SOURCES_DIST =  \
+	src/third_party/libdisasm/ia32_implicit.c \
+	src/third_party/libdisasm/ia32_implicit.h \
+	src/third_party/libdisasm/ia32_insn.c \
+	src/third_party/libdisasm/ia32_insn.h \
+	src/third_party/libdisasm/ia32_invariant.c \
+	src/third_party/libdisasm/ia32_invariant.h \
+	src/third_party/libdisasm/ia32_modrm.c \
+	src/third_party/libdisasm/ia32_modrm.h \
+	src/third_party/libdisasm/ia32_opcode_tables.c \
+	src/third_party/libdisasm/ia32_opcode_tables.h \
+	src/third_party/libdisasm/ia32_operand.c \
+	src/third_party/libdisasm/ia32_operand.h \
+	src/third_party/libdisasm/ia32_reg.c \
+	src/third_party/libdisasm/ia32_reg.h \
+	src/third_party/libdisasm/ia32_settings.c \
+	src/third_party/libdisasm/ia32_settings.h \
+	src/third_party/libdisasm/libdis.h \
+	src/third_party/libdisasm/qword.h \
+	src/third_party/libdisasm/x86_disasm.c \
+	src/third_party/libdisasm/x86_format.c \
+	src/third_party/libdisasm/x86_imm.c \
+	src/third_party/libdisasm/x86_imm.h \
+	src/third_party/libdisasm/x86_insn.c \
+	src/third_party/libdisasm/x86_misc.c \
+	src/third_party/libdisasm/x86_operand_list.c \
+	src/third_party/libdisasm/x86_operand_list.h
+@DISABLE_PROCESSOR_FALSE@am_src_third_party_libdisasm_libdisasm_a_OBJECTS = src/third_party/libdisasm/ia32_implicit.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/third_party/libdisasm/ia32_insn.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/third_party/libdisasm/ia32_invariant.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/third_party/libdisasm/ia32_modrm.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/third_party/libdisasm/ia32_opcode_tables.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/third_party/libdisasm/ia32_operand.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/third_party/libdisasm/ia32_reg.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/third_party/libdisasm/ia32_settings.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/third_party/libdisasm/x86_disasm.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/third_party/libdisasm/x86_format.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/third_party/libdisasm/x86_imm.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/third_party/libdisasm/x86_insn.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/third_party/libdisasm/x86_misc.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/third_party/libdisasm/x86_operand_list.$(OBJEXT)
+src_third_party_libdisasm_libdisasm_a_OBJECTS =  \
+	$(am_src_third_party_libdisasm_libdisasm_a_OBJECTS)
+@LINUX_HOST_TRUE@am__EXEEXT_1 = src/client/linux/linux_dumper_unittest_helper$(EXEEXT) \
+@LINUX_HOST_TRUE@	src/client/linux/linux_client_unittest_shlib$(EXEEXT)
+@DISABLE_PROCESSOR_FALSE@am__EXEEXT_2 = src/processor/microdump_stackwalk$(EXEEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/minidump_dump$(EXEEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/minidump_stackwalk$(EXEEXT)
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am__EXEEXT_3 = src/tools/linux/core2md/core2md$(EXEEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/tools/linux/dump_syms/dump_syms$(EXEEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/tools/linux/md2core/minidump-2-core$(EXEEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/tools/linux/symupload/minidump_upload$(EXEEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/tools/linux/symupload/sym_upload$(EXEEXT)
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@am__EXEEXT_4 = src/tools/mac/dump_syms/dump_syms_mac$(EXEEXT)
+@DISABLE_PROCESSOR_FALSE@am__EXEEXT_5 = src/common/test_assembler_unittest$(EXEEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/address_map_unittest$(EXEEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/basic_source_line_resolver_unittest$(EXEEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/cfi_frame_info_unittest$(EXEEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/contained_range_map_unittest$(EXEEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/disassembler_x86_unittest$(EXEEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/exploitability_unittest$(EXEEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/fast_source_line_resolver_unittest$(EXEEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/map_serializers_unittest$(EXEEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/microdump_processor_unittest$(EXEEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/minidump_processor_unittest$(EXEEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/minidump_unittest$(EXEEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/static_address_map_unittest$(EXEEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/static_contained_range_map_unittest$(EXEEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/static_map_unittest$(EXEEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/static_range_map_unittest$(EXEEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/pathname_stripper_unittest$(EXEEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/postfix_evaluator_unittest$(EXEEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/proc_maps_linux_unittest$(EXEEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/range_map_shrink_down_unittest$(EXEEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/range_map_unittest$(EXEEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_amd64_unittest$(EXEEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_arm_unittest$(EXEEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_arm64_unittest$(EXEEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_address_list_unittest$(EXEEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_mips_unittest$(EXEEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_mips64_unittest$(EXEEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_x86_unittest$(EXEEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/processor/synth_minidump_unittest$(EXEEXT)
+@LINUX_HOST_TRUE@am__EXEEXT_6 = src/client/linux/linux_client_unittest$(EXEEXT)
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am__EXEEXT_7 = src/common/dumper_unittest$(EXEEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/tools/linux/md2core/minidump_2_core_unittest$(EXEEXT)
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@am__EXEEXT_8 = src/common/mac/macho_reader_unittest$(EXEEXT)
+@DISABLE_PROCESSOR_FALSE@@SELFTEST_TRUE@am__EXEEXT_9 = src/processor/stackwalker_selftest$(EXEEXT)
 PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
-am_src_processor_address_map_unittest_OBJECTS =  \
-	src/processor/address_map_unittest.$(OBJEXT)
+am_src_client_linux_linux_client_unittest_OBJECTS =
+src_client_linux_linux_client_unittest_OBJECTS =  \
+	$(am_src_client_linux_linux_client_unittest_OBJECTS)
+am__DEPENDENCIES_1 =
+@SYSTEM_TEST_LIBS_FALSE@am__DEPENDENCIES_2 = src/testing/libtesting.a
+@SYSTEM_TEST_LIBS_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) \
+@SYSTEM_TEST_LIBS_TRUE@	$(am__DEPENDENCIES_1)
+src_client_linux_linux_client_unittest_LINK = $(CCLD) $(AM_CFLAGS) \
+	$(CFLAGS) $(src_client_linux_linux_client_unittest_LDFLAGS) \
+	$(LDFLAGS) -o $@
+am__src_client_linux_linux_client_unittest_shlib_SOURCES_DIST =  \
+	src/breakpad_googletest_includes.h \
+	src/testing/gtest/src/gtest-all.cc \
+	src/testing/gtest/src/gtest_main.cc \
+	src/testing/src/gmock-all.cc \
+	src/client/linux/handler/exception_handler_unittest.cc \
+	src/client/linux/minidump_writer/directory_reader_unittest.cc \
+	src/client/linux/minidump_writer/cpu_set_unittest.cc \
+	src/client/linux/minidump_writer/line_reader_unittest.cc \
+	src/client/linux/minidump_writer/linux_core_dumper.cc \
+	src/client/linux/minidump_writer/linux_core_dumper_unittest.cc \
+	src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc \
+	src/client/linux/minidump_writer/minidump_writer_unittest.cc \
+	src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc \
+	src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc \
+	src/common/linux/elf_core_dump.cc \
+	src/common/linux/linux_libc_support_unittest.cc \
+	src/common/linux/tests/auto_testfile.h \
+	src/common/linux/tests/crash_generator.cc \
+	src/common/memory_unittest.cc src/common/tests/auto_tempdir.h \
+	src/common/tests/file_utils.cc src/common/tests/file_utils.h \
+	src/processor/basic_code_modules.cc \
+	src/processor/dump_context.cc src/processor/dump_object.cc \
+	src/processor/logging.cc src/processor/minidump.cc \
+	src/processor/pathname_stripper.cc \
+	src/processor/proc_maps_linux.cc \
+	src/common/android/breakpad_getcontext.S \
+	src/client/linux/microdump_writer/microdump_writer_unittest.cc \
+	src/common/android/breakpad_getcontext_unittest.cc
+@SYSTEM_TEST_LIBS_FALSE@am__objects_2 = src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest-all.$(OBJEXT) \
+@SYSTEM_TEST_LIBS_FALSE@	src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest_main.$(OBJEXT) \
+@SYSTEM_TEST_LIBS_FALSE@	src/testing/src/src_client_linux_linux_client_unittest_shlib-gmock-all.$(OBJEXT)
+@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@am__objects_3 = src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.$(OBJEXT)
+@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@am__objects_4 = src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.$(OBJEXT)
+@LINUX_HOST_TRUE@am_src_client_linux_linux_client_unittest_shlib_OBJECTS =  \
+@LINUX_HOST_TRUE@	$(am__objects_2) \
+@LINUX_HOST_TRUE@	src/client/linux/handler/src_client_linux_linux_client_unittest_shlib-exception_handler_unittest.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-directory_reader_unittest.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-cpu_set_unittest.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-line_reader_unittest.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-linux_core_dumper.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-linux_core_dumper_unittest.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-linux_ptrace_dumper_unittest.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest_utils.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/common/linux/src_client_linux_linux_client_unittest_shlib-elf_core_dump.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/common/linux/src_client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/common/linux/tests/src_client_linux_linux_client_unittest_shlib-crash_generator.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/common/src_client_linux_linux_client_unittest_shlib-memory_unittest.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/common/tests/src_client_linux_linux_client_unittest_shlib-file_utils.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/processor/src_client_linux_linux_client_unittest_shlib-basic_code_modules.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/processor/src_client_linux_linux_client_unittest_shlib-dump_context.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/processor/src_client_linux_linux_client_unittest_shlib-dump_object.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/processor/src_client_linux_linux_client_unittest_shlib-logging.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/processor/src_client_linux_linux_client_unittest_shlib-minidump.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/processor/src_client_linux_linux_client_unittest_shlib-pathname_stripper.$(OBJEXT) \
+@LINUX_HOST_TRUE@	src/processor/src_client_linux_linux_client_unittest_shlib-proc_maps_linux.$(OBJEXT) \
+@LINUX_HOST_TRUE@	$(am__objects_3) \
+@LINUX_HOST_TRUE@	src/client/linux/microdump_writer/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.$(OBJEXT) \
+@LINUX_HOST_TRUE@	$(am__objects_4)
+src_client_linux_linux_client_unittest_shlib_OBJECTS =  \
+	$(am_src_client_linux_linux_client_unittest_shlib_OBJECTS)
+src_client_linux_linux_client_unittest_shlib_LINK = $(CXXLD) \
+	$(AM_CXXFLAGS) $(CXXFLAGS) \
+	$(src_client_linux_linux_client_unittest_shlib_LDFLAGS) \
+	$(LDFLAGS) -o $@
+am__src_client_linux_linux_dumper_unittest_helper_SOURCES_DIST = src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
+@LINUX_HOST_TRUE@am_src_client_linux_linux_dumper_unittest_helper_OBJECTS = src/client/linux/minidump_writer/src_client_linux_linux_dumper_unittest_helper-linux_dumper_unittest_helper.$(OBJEXT)
+src_client_linux_linux_dumper_unittest_helper_OBJECTS =  \
+	$(am_src_client_linux_linux_dumper_unittest_helper_OBJECTS)
+src_client_linux_linux_dumper_unittest_helper_LDADD = $(LDADD)
+src_client_linux_linux_dumper_unittest_helper_LINK = $(CXXLD) \
+	$(src_client_linux_linux_dumper_unittest_helper_CXXFLAGS) \
+	$(CXXFLAGS) \
+	$(src_client_linux_linux_dumper_unittest_helper_LDFLAGS) \
+	$(LDFLAGS) -o $@
+am__src_common_dumper_unittest_SOURCES_DIST =  \
+	src/common/byte_cursor_unittest.cc \
+	src/common/dwarf_cfi_to_module.cc \
+	src/common/dwarf_cfi_to_module_unittest.cc \
+	src/common/dwarf_cu_to_module.cc \
+	src/common/dwarf_cu_to_module_unittest.cc \
+	src/common/dwarf_line_to_module.cc \
+	src/common/dwarf_line_to_module_unittest.cc \
+	src/common/language.cc src/common/memory_range_unittest.cc \
+	src/common/module.cc src/common/module_unittest.cc \
+	src/common/stabs_reader.cc src/common/stabs_reader_unittest.cc \
+	src/common/stabs_to_module.cc \
+	src/common/stabs_to_module_unittest.cc \
+	src/common/test_assembler.cc src/common/dwarf/bytereader.cc \
+	src/common/dwarf/bytereader.h \
+	src/common/dwarf/bytereader-inl.h \
+	src/common/dwarf/bytereader_unittest.cc \
+	src/common/dwarf/cfi_assembler.cc \
+	src/common/dwarf/cfi_assembler.h \
+	src/common/dwarf/dwarf2diehandler.cc \
+	src/common/dwarf/dwarf2diehandler_unittest.cc \
+	src/common/dwarf/dwarf2reader.cc \
+	src/common/dwarf/dwarf2reader.h src/common/dwarf/elf_reader.cc \
+	src/common/dwarf/elf_reader.h \
+	src/common/dwarf/dwarf2reader_cfi_unittest.cc \
+	src/common/dwarf/dwarf2reader_die_unittest.cc \
+	src/common/dwarf/dwarf2reader_test_common.h \
+	src/common/linux/crc32.cc src/common/linux/dump_symbols.cc \
+	src/common/linux/dump_symbols_unittest.cc \
+	src/common/linux/elf_core_dump.cc \
+	src/common/linux/elf_core_dump_unittest.cc \
+	src/common/linux/elf_symbols_to_module.cc \
+	src/common/linux/elf_symbols_to_module_unittest.cc \
+	src/common/linux/elfutils.cc src/common/linux/file_id.cc \
+	src/common/linux/file_id_unittest.cc \
+	src/common/linux/linux_libc_support.cc \
+	src/common/linux/memory_mapped_file.cc \
+	src/common/linux/memory_mapped_file_unittest.cc \
+	src/common/linux/safe_readlink.cc \
+	src/common/linux/safe_readlink_unittest.cc \
+	src/common/linux/synth_elf.cc \
+	src/common/linux/synth_elf_unittest.cc \
+	src/common/linux/tests/crash_generator.cc \
+	src/common/linux/tests/crash_generator.h \
+	src/common/testdata/func-line-pairing.h \
+	src/common/tests/file_utils.cc
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am_src_common_dumper_unittest_OBJECTS = src/common/src_common_dumper_unittest-byte_cursor_unittest.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/src_common_dumper_unittest-dwarf_cfi_to_module.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/src_common_dumper_unittest-dwarf_cfi_to_module_unittest.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/src_common_dumper_unittest-dwarf_cu_to_module.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/src_common_dumper_unittest-dwarf_cu_to_module_unittest.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/src_common_dumper_unittest-dwarf_line_to_module.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/src_common_dumper_unittest-dwarf_line_to_module_unittest.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/src_common_dumper_unittest-language.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/src_common_dumper_unittest-memory_range_unittest.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/src_common_dumper_unittest-module.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/src_common_dumper_unittest-module_unittest.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/src_common_dumper_unittest-stabs_reader.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/src_common_dumper_unittest-stabs_reader_unittest.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/src_common_dumper_unittest-stabs_to_module.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/src_common_dumper_unittest-stabs_to_module_unittest.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/src_common_dumper_unittest-test_assembler.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/dwarf/src_common_dumper_unittest-bytereader.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/dwarf/src_common_dumper_unittest-bytereader_unittest.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/dwarf/src_common_dumper_unittest-cfi_assembler.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/dwarf/src_common_dumper_unittest-dwarf2diehandler.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/dwarf/src_common_dumper_unittest-dwarf2diehandler_unittest.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/dwarf/src_common_dumper_unittest-dwarf2reader.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/dwarf/src_common_dumper_unittest-elf_reader.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/dwarf/src_common_dumper_unittest-dwarf2reader_cfi_unittest.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/dwarf/src_common_dumper_unittest-dwarf2reader_die_unittest.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/linux/src_common_dumper_unittest-crc32.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/linux/src_common_dumper_unittest-dump_symbols.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/linux/src_common_dumper_unittest-dump_symbols_unittest.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/linux/src_common_dumper_unittest-elf_core_dump.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/linux/src_common_dumper_unittest-elf_core_dump_unittest.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/linux/src_common_dumper_unittest-elf_symbols_to_module.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/linux/src_common_dumper_unittest-elf_symbols_to_module_unittest.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/linux/src_common_dumper_unittest-elfutils.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/linux/src_common_dumper_unittest-file_id.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/linux/src_common_dumper_unittest-file_id_unittest.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/linux/src_common_dumper_unittest-linux_libc_support.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/linux/src_common_dumper_unittest-memory_mapped_file.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/linux/src_common_dumper_unittest-memory_mapped_file_unittest.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/linux/src_common_dumper_unittest-safe_readlink.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/linux/src_common_dumper_unittest-safe_readlink_unittest.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/linux/src_common_dumper_unittest-synth_elf.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/linux/src_common_dumper_unittest-synth_elf_unittest.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/linux/tests/src_common_dumper_unittest-crash_generator.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/tests/src_common_dumper_unittest-file_utils.$(OBJEXT)
+src_common_dumper_unittest_OBJECTS =  \
+	$(am_src_common_dumper_unittest_OBJECTS)
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_dumper_unittest_DEPENDENCIES =  \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	$(am__DEPENDENCIES_2) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	$(am__DEPENDENCIES_1) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	$(am__DEPENDENCIES_1)
+am__src_common_mac_macho_reader_unittest_SOURCES_DIST =  \
+	src/common/dwarf_cfi_to_module.cc \
+	src/common/dwarf_cu_to_module.cc \
+	src/common/dwarf_line_to_module.cc src/common/language.cc \
+	src/common/md5.cc src/common/module.cc \
+	src/common/stabs_reader.cc src/common/stabs_to_module.cc \
+	src/common/test_assembler.cc src/common/dwarf/bytereader.cc \
+	src/common/dwarf/cfi_assembler.cc \
+	src/common/dwarf/dwarf2diehandler.cc \
+	src/common/dwarf/dwarf2reader.cc \
+	src/common/dwarf/elf_reader.cc \
+	src/common/mac/arch_utilities.cc src/common/mac/file_id.cc \
+	src/common/mac/macho_id.cc src/common/mac/macho_reader.cc \
+	src/common/mac/macho_reader_unittest.cc \
+	src/common/mac/macho_utilities.cc \
+	src/common/mac/macho_walker.cc src/common/tests/file_utils.cc
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am_src_common_mac_macho_reader_unittest_OBJECTS = src/common/src_common_mac_macho_reader_unittest-dwarf_cfi_to_module.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/src_common_mac_macho_reader_unittest-dwarf_cu_to_module.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/src_common_mac_macho_reader_unittest-dwarf_line_to_module.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/src_common_mac_macho_reader_unittest-language.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/src_common_mac_macho_reader_unittest-md5.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/src_common_mac_macho_reader_unittest-module.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/src_common_mac_macho_reader_unittest-stabs_reader.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/src_common_mac_macho_reader_unittest-stabs_to_module.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/src_common_mac_macho_reader_unittest-test_assembler.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/dwarf/src_common_mac_macho_reader_unittest-bytereader.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/dwarf/src_common_mac_macho_reader_unittest-cfi_assembler.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2diehandler.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2reader.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/dwarf/src_common_mac_macho_reader_unittest-elf_reader.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/mac/src_common_mac_macho_reader_unittest-arch_utilities.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/mac/src_common_mac_macho_reader_unittest-file_id.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/mac/src_common_mac_macho_reader_unittest-macho_id.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/mac/src_common_mac_macho_reader_unittest-macho_reader.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/mac/src_common_mac_macho_reader_unittest-macho_reader_unittest.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/mac/src_common_mac_macho_reader_unittest-macho_utilities.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/mac/src_common_mac_macho_reader_unittest-macho_walker.$(OBJEXT) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	src/common/tests/src_common_mac_macho_reader_unittest-file_utils.$(OBJEXT)
+src_common_mac_macho_reader_unittest_OBJECTS =  \
+	$(am_src_common_mac_macho_reader_unittest_OBJECTS)
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_mac_macho_reader_unittest_DEPENDENCIES =  \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	$(am__DEPENDENCIES_2) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	$(am__DEPENDENCIES_1) \
+@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@	$(am__DEPENDENCIES_1)
+am__src_common_test_assembler_unittest_SOURCES_DIST =  \
+	src/common/test_assembler.cc src/common/test_assembler.h \
+	src/common/test_assembler_unittest.cc
+@DISABLE_PROCESSOR_FALSE@am_src_common_test_assembler_unittest_OBJECTS = src/common/src_common_test_assembler_unittest-test_assembler.$(OBJEXT) \
+@DISABLE_PROCESSOR_FALSE@	src/common/src_common_test_assembler_unittest-test_assembler_unittest.$(OBJEXT)
+src_common_test_assembler_unittest_OBJECTS =  \
+	$(am_src_common_test_assembler_unittest_OBJECTS)
+@DISABLE_PROCESSOR_FALSE@src_common_test_assembler_unittest_DEPENDENCIES =  \
+@DISABLE_PROCESSOR_FALSE@	$(am__DEPENDENCIES_2) \
+@DISABLE_PROCESSOR_FALSE@	$(am__DEPENDENCIES_1) \
+@DISABLE_PROCESSOR_FALSE@	$(am__DEPENDENCIES_1)
+am__src_processor_address_map_unittest_SOURCES_DIST =  \
+	src/processor/address_map_unittest.cc
+@DISABLE_PROCESSOR_FALSE@am_src_processor_address_map_unittest_OBJECTS = src/processor/address_map_unittest.$(OBJEXT)
 src_processor_address_map_unittest_OBJECTS =  \
 	$(am_src_processor_address_map_unittest_OBJECTS)
-src_processor_address_map_unittest_DEPENDENCIES =  \
-	src/processor/logging.lo src/processor/pathname_stripper.lo
-am_src_processor_basic_source_line_resolver_unittest_OBJECTS =  \
-	src/processor/basic_source_line_resolver_unittest.$(OBJEXT)
+@DISABLE_PROCESSOR_FALSE@src_processor_address_map_unittest_DEPENDENCIES =  \
+@DISABLE_PROCESSOR_FALSE@	src/processor/logging.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/pathname_stripper.o
+am__src_processor_basic_source_line_resolver_unittest_SOURCES_DIST =  \
+	src/processor/basic_source_line_resolver_unittest.cc
+@DISABLE_PROCESSOR_FALSE@am_src_processor_basic_source_line_resolver_unittest_OBJECTS = src/processor/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.$(OBJEXT)
 src_processor_basic_source_line_resolver_unittest_OBJECTS = $(am_src_processor_basic_source_line_resolver_unittest_OBJECTS)
-src_processor_basic_source_line_resolver_unittest_DEPENDENCIES =  \
-	src/processor/basic_source_line_resolver.lo \
-	src/processor/pathname_stripper.lo src/processor/logging.lo
-am_src_processor_contained_range_map_unittest_OBJECTS =  \
-	src/processor/contained_range_map_unittest.$(OBJEXT)
+@DISABLE_PROCESSOR_FALSE@src_processor_basic_source_line_resolver_unittest_DEPENDENCIES = src/processor/basic_source_line_resolver.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/cfi_frame_info.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/pathname_stripper.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/logging.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/source_line_resolver_base.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/tokenize.o \
+@DISABLE_PROCESSOR_FALSE@	$(am__DEPENDENCIES_2) \
+@DISABLE_PROCESSOR_FALSE@	$(am__DEPENDENCIES_1) \
+@DISABLE_PROCESSOR_FALSE@	$(am__DEPENDENCIES_1)
+am__src_processor_cfi_frame_info_unittest_SOURCES_DIST =  \
+	src/processor/cfi_frame_info_unittest.cc
+@DISABLE_PROCESSOR_FALSE@am_src_processor_cfi_frame_info_unittest_OBJECTS = src/processor/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.$(OBJEXT)
+src_processor_cfi_frame_info_unittest_OBJECTS =  \
+	$(am_src_processor_cfi_frame_info_unittest_OBJECTS)
+@DISABLE_PROCESSOR_FALSE@src_processor_cfi_frame_info_unittest_DEPENDENCIES =  \
+@DISABLE_PROCESSOR_FALSE@	src/processor/cfi_frame_info.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/logging.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/pathname_stripper.o \
+@DISABLE_PROCESSOR_FALSE@	$(am__DEPENDENCIES_2) \
+@DISABLE_PROCESSOR_FALSE@	$(am__DEPENDENCIES_1) \
+@DISABLE_PROCESSOR_FALSE@	$(am__DEPENDENCIES_1)
+am__src_processor_contained_range_map_unittest_SOURCES_DIST =  \
+	src/processor/contained_range_map_unittest.cc
+@DISABLE_PROCESSOR_FALSE@am_src_processor_contained_range_map_unittest_OBJECTS = src/processor/contained_range_map_unittest.$(OBJEXT)
 src_processor_contained_range_map_unittest_OBJECTS =  \
 	$(am_src_processor_contained_range_map_unittest_OBJECTS)
-src_processor_contained_range_map_unittest_DEPENDENCIES =  \
-	src/processor/logging.lo src/processor/pathname_stripper.lo
-am_src_processor_minidump_dump_OBJECTS =  \
-	src/processor/minidump_dump.$(OBJEXT)
+@DISABLE_PROCESSOR_FALSE@src_processor_contained_range_map_unittest_DEPENDENCIES =  \
+@DISABLE_PROCESSOR_FALSE@	src/processor/logging.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/pathname_stripper.o
+am__src_processor_disassembler_x86_unittest_SOURCES_DIST =  \
+	src/processor/disassembler_x86_unittest.cc
+@DISABLE_PROCESSOR_FALSE@am_src_processor_disassembler_x86_unittest_OBJECTS = src/processor/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.$(OBJEXT)
+src_processor_disassembler_x86_unittest_OBJECTS =  \
+	$(am_src_processor_disassembler_x86_unittest_OBJECTS)
+@DISABLE_PROCESSOR_FALSE@src_processor_disassembler_x86_unittest_DEPENDENCIES =  \
+@DISABLE_PROCESSOR_FALSE@	src/processor/disassembler_x86.o \
+@DISABLE_PROCESSOR_FALSE@	src/third_party/libdisasm/libdisasm.a \
+@DISABLE_PROCESSOR_FALSE@	$(am__DEPENDENCIES_2) \
+@DISABLE_PROCESSOR_FALSE@	$(am__DEPENDENCIES_1) \
+@DISABLE_PROCESSOR_FALSE@	$(am__DEPENDENCIES_1)
+am__src_processor_exploitability_unittest_SOURCES_DIST =  \
+	src/processor/exploitability_unittest.cc
+@DISABLE_PROCESSOR_FALSE@am_src_processor_exploitability_unittest_OBJECTS = src/processor/src_processor_exploitability_unittest-exploitability_unittest.$(OBJEXT)
+src_processor_exploitability_unittest_OBJECTS =  \
+	$(am_src_processor_exploitability_unittest_OBJECTS)
+@DISABLE_PROCESSOR_FALSE@src_processor_exploitability_unittest_DEPENDENCIES =  \
+@DISABLE_PROCESSOR_FALSE@	src/processor/minidump_processor.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/process_state.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/disassembler_x86.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/exploitability.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/exploitability_linux.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/exploitability_win.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/basic_code_modules.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/basic_source_line_resolver.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/call_stack.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/cfi_frame_info.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/dump_context.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/dump_object.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/logging.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/minidump.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/pathname_stripper.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/proc_maps_linux.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/simple_symbol_supplier.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/source_line_resolver_base.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stack_frame_cpu.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stack_frame_symbolizer.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_address_list.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_amd64.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_arm.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_arm64.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_mips.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_ppc.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_ppc64.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_sparc.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_x86.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/symbolic_constants_win.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/tokenize.o \
+@DISABLE_PROCESSOR_FALSE@	src/third_party/libdisasm/libdisasm.a \
+@DISABLE_PROCESSOR_FALSE@	$(am__DEPENDENCIES_2) \
+@DISABLE_PROCESSOR_FALSE@	$(am__DEPENDENCIES_1) \
+@DISABLE_PROCESSOR_FALSE@	$(am__DEPENDENCIES_1)
+am__src_processor_fast_source_line_resolver_unittest_SOURCES_DIST =  \
+	src/processor/fast_source_line_resolver_unittest.cc
+@DISABLE_PROCESSOR_FALSE@am_src_processor_fast_source_line_resolver_unittest_OBJECTS = src/processor/src_processor_fast_source_line_resolver_unittest-fast_source_line_resolver_unittest.$(OBJEXT)
+src_processor_fast_source_line_resolver_unittest_OBJECTS = $(am_src_processor_fast_source_line_resolver_unittest_OBJECTS)
+@DISABLE_PROCESSOR_FALSE@src_processor_fast_source_line_resolver_unittest_DEPENDENCIES = src/processor/fast_source_line_resolver.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/basic_source_line_resolver.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/cfi_frame_info.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/module_comparer.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/module_serializer.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/pathname_stripper.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/logging.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/source_line_resolver_base.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/tokenize.o \
+@DISABLE_PROCESSOR_FALSE@	$(am__DEPENDENCIES_2) \
+@DISABLE_PROCESSOR_FALSE@	$(am__DEPENDENCIES_1) \
+@DISABLE_PROCESSOR_FALSE@	$(am__DEPENDENCIES_1)
+am__src_processor_map_serializers_unittest_SOURCES_DIST =  \
+	src/processor/map_serializers_unittest.cc
+@DISABLE_PROCESSOR_FALSE@am_src_processor_map_serializers_unittest_OBJECTS = src/processor/src_processor_map_serializers_unittest-map_serializers_unittest.$(OBJEXT)
+src_processor_map_serializers_unittest_OBJECTS =  \
+	$(am_src_processor_map_serializers_unittest_OBJECTS)
+@DISABLE_PROCESSOR_FALSE@src_processor_map_serializers_unittest_DEPENDENCIES =  \
+@DISABLE_PROCESSOR_FALSE@	src/processor/logging.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/pathname_stripper.o \
+@DISABLE_PROCESSOR_FALSE@	$(am__DEPENDENCIES_2) \
+@DISABLE_PROCESSOR_FALSE@	$(am__DEPENDENCIES_1) \
+@DISABLE_PROCESSOR_FALSE@	$(am__DEPENDENCIES_1)
+am__src_processor_microdump_processor_unittest_SOURCES_DIST =  \
+	src/processor/microdump_processor_unittest.cc
+@DISABLE_PROCESSOR_FALSE@am_src_processor_microdump_processor_unittest_OBJECTS = src/processor/src_processor_microdump_processor_unittest-microdump_processor_unittest.$(OBJEXT)
+src_processor_microdump_processor_unittest_OBJECTS =  \
+	$(am_src_processor_microdump_processor_unittest_OBJECTS)
+@DISABLE_PROCESSOR_FALSE@src_processor_microdump_processor_unittest_DEPENDENCIES =  \
+@DISABLE_PROCESSOR_FALSE@	src/processor/basic_code_modules.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/basic_source_line_resolver.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/call_stack.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/cfi_frame_info.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/dump_context.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/dump_object.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/logging.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/microdump.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/microdump_processor.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/pathname_stripper.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/process_state.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/simple_symbol_supplier.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/source_line_resolver_base.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stack_frame_symbolizer.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_address_list.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_amd64.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_arm.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_arm64.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_mips.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_ppc.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_ppc64.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_sparc.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/stackwalker_x86.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/tokenize.o \
+@DISABLE_PROCESSOR_FALSE@	$(am__DEPENDENCIES_2) \
+@DISABLE_PROCESSOR_FALSE@	$(am__DEPENDENCIES_1) \
+@DISABLE_PROCESSOR_FALSE@	$(am__DEPENDENCIES_1)
+am__src_processor_microdump_stackwalk_SOURCES_DIST =  \
+	src/processor/microdump_stackwalk.cc
+@DISABLE_PROCESSOR_FALSE@am_src_processor_microdump_stackwalk_OBJECTS = src/processor/microdump_stackwalk.$(OBJEXT)
+src_processor_microdump_stackwalk_OBJECTS =  \
+	$(am_src_processor_microdump_stackwalk_OBJECTS)
+@DISABLE_PROCESSOR_FALSE@src_processor_microdump_stackwalk_DEPENDENCIES =  \
+@DISABLE_PROCESSOR_FALSE@	src/processor/basic_code_modules.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/basic_source_line_resolver.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/call_stack.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/cfi_frame_info.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/disassembler_x86.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/dump_context.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/dump_object.o \
+@DISABLE_PROCESSOR_FALSE@	src/processor/logging.o \
+@DISABLE_P