Bug 1276119 - part1: don't call WindowSuspendChanged if the plugin is already muted.
authorAlastor Wu <alwu@mozilla.com>
Tue, 31 May 2016 10:17:47 +0800
changeset 340626 c27e49247fe28294d7f04e54d00ab389b5e57378
parent 340625 109250561b779e707f1f8cde8f54da8f6efb4c06
child 340627 ba07e25e6d1d12276609a02d241d90fc01421c23
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1276119
milestone49.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 1276119 - part1: don't call WindowSuspendChanged if the plugin is already muted. MozReview-Commit-ID: 8HlmEAqd1n
dom/plugins/base/nsNPAPIPlugin.cpp
--- a/dom/plugins/base/nsNPAPIPlugin.cpp
+++ b/dom/plugins/base/nsNPAPIPlugin.cpp
@@ -2298,16 +2298,23 @@ NPError
           return NPERR_NO_ERROR;
         }
 
         rv = inst->WindowVolumeChanged(config.mVolume, config.mMuted);
         if (NS_WARN_IF(NS_FAILED(rv))) {
           return NPERR_NO_ERROR;
         }
 
+        // Since we only support for muting now, the implementation of suspend
+        // is equal to muting. Therefore, if we have already muted the plugin,
+        // then we don't need to call WindowSuspendChanged() again.
+        if (config.mMuted) {
+          return NPERR_NO_ERROR;
+        }
+
         rv = inst->WindowSuspendChanged(config.mSuspend);
         if (NS_WARN_IF(NS_FAILED(rv))) {
           return NPERR_NO_ERROR;
         }
       }
 
       return NPERR_NO_ERROR;
     }