Bug 876397 - Inter-App Communication API (part 8, follow-up). r=bent
authorGene Lian <clian@mozilla.com>
Thu, 12 Sep 2013 22:14:48 +0800
changeset 159749 c1780559f076ed3f6b114855c407b864fb6cbe78
parent 159748 fb5ba2a8e03922610f245a6ea4de36038b961411
child 159750 9527d405ceea8dc4135b15da25067417f117f534
push id2961
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 21:59:28 +0000
treeherdermozilla-beta@73ef4f13486f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbent
bugs876397
milestone26.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 876397 - Inter-App Communication API (part 8, follow-up). r=bent
dom/apps/src/InterAppConnection.js
dom/apps/src/InterAppMessagePort.js
dom/apps/src/Webapps.js
dom/webidl/InterAppMessagePort.webidl
--- a/dom/apps/src/InterAppConnection.js
+++ b/dom/apps/src/InterAppConnection.js
@@ -116,18 +116,17 @@ function InterAppConnectionRequestWrappe
   if (DEBUG) debug("InterAppConnectionRequestWrapper()");
 }
 
 InterAppConnectionRequestWrapper.prototype = {
   // nsISystemMessagesWrapper implementation.
   wrapMessage: function(aMessage, aWindow) {
     if (DEBUG) debug("wrapMessage: " + JSON.stringify(aMessage));
 
-    let port = new aWindow.MozInterAppMessagePort(aMessage.keyword,
-                                                  aMessage.messagePortID, false);
+    let port = new aWindow.MozInterAppMessagePort(aMessage.messagePortID);
     let connectionRequest =
       new aWindow.MozInterAppConnectionRequest(aMessage.keyword, port);
 
     return connectionRequest;
   },
 
   classDescription: "InterAppConnectionRequestWrapper",
 
--- a/dom/apps/src/InterAppMessagePort.js
+++ b/dom/apps/src/InterAppMessagePort.js
@@ -83,23 +83,21 @@ InterAppMessagePort.prototype = {
     this._pageURL = principal.URI.spec;
 
     this._started = false;
     this._closed = false;
     this._messageQueue = [];
   },
 
   // WebIDL implementation for constructor.
-  __init: function(aKeyword, aMessagePortID) {
+  __init: function(aMessagePortID) {
     if (DEBUG) {
-      debug("Calling __init(): aKeyword: " + aKeyword +
-            " aMessagePortID: " + aMessagePortID);
+      debug("Calling __init(): aMessagePortID: " + aMessagePortID);
     }
 
-    this._keyword = aKeyword;
     this._messagePortID = aMessagePortID;
 
     cpmm.sendAsyncMessage("InterAppMessagePort:Register",
                           { messagePortID: this._messagePortID,
                             manifestURL: this._manifestURL,
                             pageURL: this._pageURL });
   },
 
--- a/dom/apps/src/Webapps.js
+++ b/dom/apps/src/Webapps.js
@@ -634,18 +634,17 @@ WebappsApplication.prototype = {
         }
         break;
       case "Webapps:ClearBrowserData:Return":
         Services.DOMRequest.fireSuccess(req, null);
         break;
       case "Webapps:Connect:Return:OK":
         let messagePorts = [];
         msg.messagePortIDs.forEach(function(aPortID) {
-          let port = new this._window.MozInterAppMessagePort(msg.keyword,
-                                                             aPortID, true);
+          let port = new this._window.MozInterAppMessagePort(aPortID);
           messagePorts.push(port);
         }, this);
         req.resolve(messagePorts);
         break;
       case "Webapps:Connect:Return:KO":
         req.reject("No connections registered");
         break;
       case "Webapps:GetConnections:Return:OK":
--- a/dom/webidl/InterAppMessagePort.webidl
+++ b/dom/webidl/InterAppMessagePort.webidl
@@ -6,17 +6,17 @@
 // at Bug 643325, we will start to refactorize the common logic of both
 // Inter-App Communication and Shared Worker. For now, we hope to design an
 // MozInterAppMessagePort to meet the timeline, which still follows exactly
 // the same interface and semantic as the MessagePort is. In the future,
 // we can then align it back to MessagePort with backward compatibility.
 
 [HeaderFile="mozilla/dom/InterAppComm.h",
  Func="mozilla::dom::InterAppComm::EnabledForScope",
- Constructor(DOMString keyword, DOMString messagePortID),
+ Constructor(DOMString messagePortID),
  JSImplementation="@mozilla.org/dom/inter-app-message-port;1"]
 interface MozInterAppMessagePort : EventTarget {
   void postMessage(any message);
 
   void start();
 
   void close();