Bug 1107013 - Clear Browser Toolbox cache for local builds. r=bgrins
authorJ. Ryan Stinnett <jryans@gmail.com>
Mon, 08 Dec 2014 16:26:09 -0600
changeset 218826 9832a29c55e901591db329d01b2f64ff958141f8
parent 218825 cc368429c22a52be73ae81cbd32f6bf5375c3bdf
child 218827 27cf288a8f5c46f447ef669245ac4e3b2f575779
push id27945
push usercbook@mozilla.com
push dateTue, 09 Dec 2014 12:09:06 +0000
treeherdermozilla-central@47f0671e2c65 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgrins
bugs1107013
milestone37.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
Bug 1107013 - Clear Browser Toolbox cache for local builds. r=bgrins
browser/devtools/framework/ToolboxProcess.jsm
--- a/browser/devtools/framework/ToolboxProcess.jsm
+++ b/browser/devtools/framework/ToolboxProcess.jsm
@@ -198,16 +198,27 @@ BrowserToolboxProcess.prototype = {
 
     if (this._options.addonID) {
       xulURI += "?addonID=" + this._options.addonID;
     }
 
     dumpn("Running chrome debugging process.");
     let args = ["-no-remote", "-foreground", "-profile", this._dbgProfilePath, "-chrome", xulURI];
 
+    // During local development, incremental builds can trigger the main process
+    // to clear its startup cache with the "flag file" .purgecaches, but this
+    // file is removed during app startup time, so we aren't able to know if it
+    // was present in order to also clear the child profile's startup cache as
+    // well.
+    //
+    // As an approximation of "isLocalBuild", check for an unofficial build.
+    if (!Services.appinfo.isOfficial) {
+      args.push("-purgecaches");
+    }
+
     process.runwAsync(args, args.length, { observe: () => this.close() });
 
     this._telemetry.toolOpened("jsbrowserdebugger");
 
     dumpn("Chrome toolbox is now running...");
     this.emit("run", this);
   },