merge mozilla-inbound to mozilla-central a=merge
authorIris Hsiao <ihsiao@mozilla.com>
Mon, 22 May 2017 11:30:29 +0800
changeset 359864 9851fcb0bf4d855c36729d7de19f0fa5c9f69776
parent 359853 367944041b558ffe29edf64e8c83879a348de0ca (current diff)
parent 359863 3c4901b6206101f6a76727bf02142cb073c42a66 (diff)
child 359877 be34e03a9373e9725f52cbf46ed62c99e5a2ea94
child 359894 378dfb426a6a3b3240a507506983bdad29b6908e
push id31860
push userihsiao@mozilla.com
push dateMon, 22 May 2017 03:30:59 +0000
treeherdermozilla-central@9851fcb0bf4d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone55.0a1
first release with
nightly linux32
9851fcb0bf4d / 55.0a1 / 20170522100359 / files
nightly linux64
9851fcb0bf4d / 55.0a1 / 20170522100359 / files
nightly mac
9851fcb0bf4d / 55.0a1 / 20170522030207 / files
nightly win32
9851fcb0bf4d / 55.0a1 / 20170522030207 / files
nightly win64
9851fcb0bf4d / 55.0a1 / 20170522030207 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
merge mozilla-inbound to mozilla-central a=merge
tools/profiler/gecko/CrossProcessProfilerController.cpp
tools/profiler/public/CrossProcessProfilerController.h
--- a/toolkit/mozapps/extensions/AddonManagerStartup.cpp
+++ b/toolkit/mozapps/extensions/AddonManagerStartup.cpp
@@ -380,25 +380,29 @@ public:
 private:
   nsString mId;
   InstallLocation& mLocation;
 };
 
 already_AddRefed<nsIFile>
 Addon::FullPath()
 {
-  nsString path = mLocation.Path();
+  nsString path = Path();
 
+  // First check for an absolute path, in case we have a proxy file.
   nsCOMPtr<nsIFile> file;
-  NS_NewLocalFile(path, false, getter_AddRefs(file));
+  if (NS_SUCCEEDED(NS_NewLocalFile(path, false, getter_AddRefs(file)))) {
+    return file.forget();
+  }
+
+  // If not an absolute path, fall back to a relative path from the location.
+  NS_NewLocalFile(mLocation.Path(), false, getter_AddRefs(file));
   MOZ_RELEASE_ASSERT(file);
 
-  path = Path();
   file->AppendRelativePath(path);
-
   return file.forget();
 }
 
 NSLocationType
 Addon::LocationType()
 {
   nsString type = GetString("type", "extension");
   if (type.LowerCaseEqualsLiteral("theme")) {
--- a/toolkit/mozapps/extensions/internal/XPIProvider.jsm
+++ b/toolkit/mozapps/extensions/internal/XPIProvider.jsm
@@ -119,24 +119,32 @@ const nsIFile = Components.Constructor("
  *
  * @param {string} path
  *        The (possibly relative) path of the file.
  * @param {nsIFile} [base]
  *        An optional file to use as a base path if `path` is relative.
  * @returns {nsIFile}
  */
 function getFile(path, base = null) {
-  if (base) {
-    let file = base.clone();
-    try {
-      file.appendRelativePath(path);
-      return file;
-    } catch (e) {}
-  }
-  return new nsIFile(path);
+  // First try for an absolute path, as we get in the case of proxy
+  // files. Ideally we would try a relative path first, but on Windows,
+  // paths which begin with a drive letter are valid as relative paths,
+  // and treated as such.
+  try {
+    return new nsIFile(path);
+  } catch (e) {
+    // Ignore invalid relative paths. The only other error we should see
+    // here is EOM, and either way, any errors that we care about should
+    // be re-thrown below.
+  }
+
+  // If the path isn't absolute, we must have a base path.
+  let file = base.clone();
+  file.appendRelativePath(path);
+  return file;
 }
 
 /**
  * Returns the modification time of the given file, or 0 if the file
  * does not exist, or cannot be accessed.
  *
  * @param {nsIFile} file
  *        The file to retrieve the modification time for.
--- a/tools/profiler/core/platform.cpp
+++ b/tools/profiler/core/platform.cpp
@@ -2564,19 +2564,19 @@ profiler_pause()
 void
 profiler_resume()
 {
   LOG("profiler_resume");
 
   MOZ_RELEASE_ASSERT(NS_IsMainThread());
   MOZ_RELEASE_ASSERT(CorePS::Exists());
 
-  PSAutoLock lock(gPSMutex);
-
   {
+    PSAutoLock lock(gPSMutex);
+
     if (!ActivePS::Exists(lock)) {
       return;
     }
 
     ActivePS::SetIsPaused(lock, false);
   }
 
   // gPSMutex must be unlocked when we notify, to avoid potential deadlocks.