Bug 927688 - Enable background thumbnailing on beta and release. r=markh,gps
authorDrew Willcoxon <adw@mozilla.com>
Thu, 24 Oct 2013 17:17:46 -0700
changeset 166987 65d339e6816388edc6cfeae087925b8982d92025
parent 166986 635f44f658402620bba407c5107b9ac838644168
child 166988 3f41909b9433907b0178660e959105e40c3a2694
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarkh, gps
bugs927688
milestone27.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 927688 - Enable background thumbnailing on beta and release. r=markh,gps
browser/base/content/newtab/newTab.js
browser/base/content/newtab/sites.js
toolkit/components/thumbnails/BackgroundPageThumbs.jsm
toolkit/components/thumbnails/jar.mn
toolkit/components/thumbnails/moz.build
toolkit/components/thumbnails/test/Makefile.in
toolkit/components/thumbnails/test/browser.ini
--- a/browser/base/content/newtab/newTab.js
+++ b/browser/base/content/newtab/newTab.js
@@ -5,19 +5,17 @@
 "use strict";
 
 let Cu = Components.utils;
 let Ci = Components.interfaces;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/PageThumbs.jsm");
-#ifndef RELEASE_BUILD
 Cu.import("resource://gre/modules/BackgroundPageThumbs.jsm");
-#endif
 Cu.import("resource://gre/modules/NewTabUtils.jsm");
 Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 
 XPCOMUtils.defineLazyModuleGetter(this, "Rect",
   "resource://gre/modules/Geometry.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
   "resource://gre/modules/PrivateBrowsingUtils.jsm");
 
--- a/browser/base/content/newtab/sites.js
+++ b/browser/base/content/newtab/sites.js
@@ -126,22 +126,20 @@ Site.prototype = {
 
     let link = this._querySelector(".newtab-link");
     link.setAttribute("title", tooltip);
     link.setAttribute("href", url);
     this._querySelector(".newtab-title").textContent = title;
 
     if (this.isPinned())
       this._updateAttributes(true);
-#ifndef RELEASE_BUILD
-    // request a staleness check for the thumbnail, which will cause page.js
+    // Capture the page if the thumbnail is missing, which will cause page.js
     // to be notified and call our refreshThumbnail() method.
     BackgroundPageThumbs.captureIfMissing(this.url);
     // but still display whatever thumbnail might be available now.
-#endif
     this.refreshThumbnail();
   },
 
   /**
    * Refreshes the thumbnail for the site.
    */
   refreshThumbnail: function Site_refreshThumbnail() {
     let thumbnailURL = PageThumbs.getThumbnailURL(this.url);
--- a/toolkit/components/thumbnails/BackgroundPageThumbs.jsm
+++ b/toolkit/components/thumbnails/BackgroundPageThumbs.jsm
@@ -1,19 +1,12 @@
 /* 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/. */
 
-/**
- * WARNING: BackgroundPageThumbs.jsm is currently excluded from release builds.
- * If you use it, you must also exclude your caller when RELEASE_BUILD is
- * defined, as described here:
- * https://wiki.mozilla.org/Platform/Channel-specific_build_defines
- */
-
 const EXPORTED_SYMBOLS = [
   "BackgroundPageThumbs",
 ];
 
 const DEFAULT_CAPTURE_TIMEOUT = 30000; // ms
 const DESTROY_BROWSER_TIMEOUT = 60000; // ms
 const FRAME_SCRIPT_URL = "chrome://global/content/backgroundPageThumbsContent.js";
 
@@ -35,21 +28,16 @@ Cu.import("resource://gre/modules/Servic
 
 const BackgroundPageThumbs = {
 
   /**
    * Asynchronously captures a thumbnail of the given URL.
    *
    * The page is loaded anonymously, and plug-ins are disabled.
    *
-   * WARNING: BackgroundPageThumbs.jsm is currently excluded from release
-   * builds.  If you use it, you must also exclude your caller when
-   * RELEASE_BUILD is defined, as described here:
-   * https://wiki.mozilla.org/Platform/Channel-specific_build_defines
-   *
    * @param url      The URL to capture.
    * @param options  An optional object that configures the capture.  Its
    *                 properties are the following, and all are optional:
    * @opt onDone     A function that will be asynchronously called when the
    *                 capture is complete or times out.  It's called as
    *                   onDone(url),
    *                 where `url` is the captured URL.
    * @opt timeout    The capture will time out after this many milliseconds have
@@ -81,21 +69,16 @@ const BackgroundPageThumbs = {
     this._capturesByURL.set(url, cap);
     this._processCaptureQueue();
   },
 
   /**
    * Asynchronously captures a thumbnail of the given URL if one does not
    * already exist.  Otherwise does nothing.
    *
-   * WARNING: BackgroundPageThumbs.jsm is currently excluded from release
-   * builds.  If you use it, you must also exclude your caller when
-   * RELEASE_BUILD is defined, as described here:
-   * https://wiki.mozilla.org/Platform/Channel-specific_build_defines
-   *
    * @param url      The URL to capture.
    * @param options  An optional object that configures the capture.  See
    *                 capture() for description.
    */
   captureIfMissing: function (url, options={}) {
     // The fileExistsForURL call is an optimization, potentially but unlikely
     // incorrect, and no big deal when it is.  After the capture is done, we
     // atomically test whether the file exists before writing it.
--- a/toolkit/components/thumbnails/jar.mn
+++ b/toolkit/components/thumbnails/jar.mn
@@ -1,8 +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/.
 
 toolkit.jar:
-#ifndef RELEASE_BUILD
 + content/global/backgroundPageThumbsContent.js (content/backgroundPageThumbsContent.js)
-#endif
--- a/toolkit/components/thumbnails/moz.build
+++ b/toolkit/components/thumbnails/moz.build
@@ -7,14 +7,12 @@
 TEST_DIRS += ['test']
 
 EXTRA_COMPONENTS += [
     'BrowserPageThumbs.manifest',
     'PageThumbsProtocol.js',
 ]
 
 EXTRA_JS_MODULES += [
+    'BackgroundPageThumbs.jsm',
     'PageThumbs.jsm',
     'PageThumbsWorker.js',
 ]
-
-if not CONFIG['RELEASE_BUILD']:
-    EXTRA_JS_MODULES += ['BackgroundPageThumbs.jsm']
--- a/toolkit/components/thumbnails/test/Makefile.in
+++ b/toolkit/components/thumbnails/test/Makefile.in
@@ -1,19 +1,10 @@
 # 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 RELEASE_BUILD
-MOCHITEST_BROWSER_FILES += \
-	browser_thumbnails_background.js \
-	browser_thumbnails_update.js \
-	thumbnails_background.sjs \
-	thumbnails_update.sjs \
-	$(NULL)
-
 ifdef MOZ_CRASHREPORTER
 MOCHITEST_BROWSER_FILES += \
 	browser_thumbnails_background_crash.js \
 	thumbnails_crash_content_helper.js \
 	$(NULL)
 endif
-endif
--- a/toolkit/components/thumbnails/test/browser.ini
+++ b/toolkit/components/thumbnails/test/browser.ini
@@ -1,17 +1,21 @@
 [DEFAULT]
 support-files =
   background_red.html
   background_red_redirect.sjs
   background_red_scroll.html
   head.js
   privacy_cache_control.sjs
+  thumbnails_background.sjs
+  thumbnails_update.sjs
 
+[browser_thumbnails_background.js]
 [browser_thumbnails_bug726727.js]
 [browser_thumbnails_bug727765.js]
 [browser_thumbnails_bug818225.js]
 [browser_thumbnails_capture.js]
 [browser_thumbnails_expiration.js]
 [browser_thumbnails_privacy.js]
 [browser_thumbnails_redirect.js]
 [browser_thumbnails_storage.js]
 [browser_thumbnails_storage_migrate3.js]
+[browser_thumbnails_update.js]