Bug 1357114 - Move the taskbar refresh timer to idle dispatch. r=florian
authorWill Wang <wiwang@mozilla.com>
Thu, 07 Sep 2017 12:15:13 +0800
changeset 379467 ca5fc64fe2aec9ee223e5b4062d1350c8c7d39af
parent 379466 38323ec9e5dad88f7131b07e30982ec108d818a1
child 379468 c366bfc13e86c94389d58ffc41c9f4a3e573d406
push id94666
push userryanvm@gmail.com
push dateThu, 07 Sep 2017 13:23:15 +0000
treeherdermozilla-inbound@ca5fc64fe2ae [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflorian
bugs1357114
milestone57.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 1357114 - Move the taskbar refresh timer to idle dispatch. r=florian
browser/modules/WindowsJumpLists.jsm
widget/windows/JumpListItem.cpp
--- a/browser/modules/WindowsJumpLists.jsm
+++ b/browser/modules/WindowsJumpLists.jsm
@@ -511,28 +511,28 @@ this.WinTaskbarJumpList =
 
   /**
    * Notification handlers
    */
 
   notify: function WTBJL_notify(aTimer) {
     // Add idle observer on the first notification so it doesn't hit startup.
     this._updateIdleObserver();
-    this.update();
+    Services.tm.idleDispatchToMainThread(() => { this.update(); });
   },
 
   observe: function WTBJL_observe(aSubject, aTopic, aData) {
     switch (aTopic) {
       case "nsPref:changed":
         if (this._enabled == true && !_prefs.getBoolPref(PREF_TASKBAR_ENABLED))
           this._deleteActiveJumpList();
         this._refreshPrefs();
         this._updateTimer();
         this._updateIdleObserver();
-        this.update();
+        Services.tm.idleDispatchToMainThread(() => { this.update(); });
       break;
 
       case "profile-before-change":
         this._shutdown();
       break;
 
       case "browser:purge-session-history":
         this.update();
--- a/widget/windows/JumpListItem.cpp
+++ b/widget/windows/JumpListItem.cpp
@@ -190,21 +190,16 @@ NS_IMETHODIMP JumpListShortcut::GetApp(n
   NS_IF_ADDREF(*aApp = mHandlerApp);
   
   return NS_OK;
 }
 
 NS_IMETHODIMP JumpListShortcut::SetApp(nsILocalHandlerApp *aApp)
 {
   mHandlerApp = aApp;
-
-  // Confirm the app is present on the system
-  if (!ExecutableExists(mHandlerApp))
-    return NS_ERROR_FILE_NOT_FOUND;
-
   return NS_OK;
 }
 
 NS_IMETHODIMP JumpListShortcut::GetIconIndex(int32_t *aIconIndex)
 {
   NS_ENSURE_ARG_POINTER(aIconIndex);
 
   *aIconIndex = mIconIndex;
@@ -610,29 +605,11 @@ nsresult JumpListLink::GetJumpListLink(I
     aLink->SetUri(uri);
 
     ::CoTaskMemFree(lpstrName);
   }
 
   return NS_OK;
 }
 
-// Confirm the app is on the system
-bool JumpListShortcut::ExecutableExists(nsCOMPtr<nsILocalHandlerApp>& handlerApp)
-{
-  nsresult rv;
-
-  if (!handlerApp)
-    return false;
-
-  nsCOMPtr<nsIFile> executable;
-  rv = handlerApp->GetExecutable(getter_AddRefs(executable));
-  if (NS_SUCCEEDED(rv) && executable) {
-    bool exists;
-    executable->Exists(&exists);
-    return exists;
-  }
-  return false;
-}
-
 } // namespace widget
 } // namespace mozilla