Bug 1485160 - part1 : Add AudibleAutoplayChild actor. r=mconley
authoralwu <alwu@mozilla.com>
Thu, 23 Aug 2018 19:05:18 +0000
changeset 488276 9c57953b24de71746904a5a56fd7a2c8d634bedf
parent 488275 85cd8690798999c98fde1394b1136af99298132b
child 488277 65c46c73f0dcd8a9eefee010ddf5a6886ded8a30
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs1485160, 1476701, 1472491
milestone63.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 1485160 - part1 : Add AudibleAutoplayChild actor. r=mconley The AudibleAutoplayMediaOccurredObserver which I added in bug1476701 was incorrectly removed by bug1472491, it's used to notify audible autoplay event for the shield study and we should add it back. Differential Revision: https://phabricator.services.mozilla.com/D3930
toolkit/actors/AudibleAutoplayChild.jsm
toolkit/actors/moz.build
toolkit/modules/ActorManagerParent.jsm
new file mode 100644
--- /dev/null
+++ b/toolkit/actors/AudibleAutoplayChild.jsm
@@ -0,0 +1,15 @@
+/* vim: set ts=2 sw=2 sts=2 et tw=80: */
+/* 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/. */
+"use strict";
+
+var EXPORTED_SYMBOLS = ["AudibleAutoplayChild"];
+
+ChromeUtils.import("resource://gre/modules/ActorChild.jsm");
+
+class AudibleAutoplayChild extends ActorChild {
+  handleEvent(event) {
+    this.mm.sendAsyncMessage("AudibleAutoplayMediaOccurred");
+  }
+}
--- a/toolkit/actors/moz.build
+++ b/toolkit/actors/moz.build
@@ -6,16 +6,17 @@
 
 with Files('**'):
     BUG_COMPONENT = ('Toolkit', 'General')
 
 with Files('Finder*.jsm'):
     BUG_COMPONENT = ('Toolkit', 'Find Toolbar')
 
 FINAL_TARGET_FILES.actors += [
+    'AudibleAutoplayChild.jsm',
     'AudioPlaybackChild.jsm',
     'BrowserChild.jsm',
     'ControllersChild.jsm',
     'DateTimePickerChild.jsm',
     'ExtFindChild.jsm',
     'FindBarChild.jsm',
     'FinderChild.jsm',
     'PopupBlockingChild.jsm',
--- a/toolkit/modules/ActorManagerParent.jsm
+++ b/toolkit/modules/ActorManagerParent.jsm
@@ -95,16 +95,25 @@
 var EXPORTED_SYMBOLS = ["ActorManagerParent"];
 
 ChromeUtils.import("resource://gre/modules/ExtensionUtils.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 const {DefaultMap} = ExtensionUtils;
 
 let ACTORS = {
+  AudibleAutoplay: {
+    child: {
+      module: "resource://gre/actors/AudibleAutoplayChild.jsm",
+      events: {
+        "AudibleAutoplayMediaOccurred": {},
+      },
+    },
+  },
+
   AudioPlayback: {
     child: {
       module: "resource://gre/actors/AudioPlaybackChild.jsm",
       messages: [
         "AudioPlayback",
       ],
       observers: [
         "audio-playback",