Bug 1114937 - Part 6: Deprecate RILContentHelper. r=echen
authorBevis Tseng <btseng@mozilla.com>
Tue, 16 Jun 2015 18:56:38 +0800
changeset 286394 69d0fee7d878518927a2c3c3ea48b8f74dd97523
parent 286393 d25074fc4e1f238972f41d48775d462a96033c6c
child 286395 8bb069f2ec5f85162d98506f35cf464380a4736f
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersechen
bugs1114937
milestone42.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 1114937 - Part 6: Deprecate RILContentHelper. r=echen
b2g/installer/package-manifest.in
dom/icc/Icc.cpp
dom/icc/IccListener.cpp
dom/icc/IccListener.h
dom/icc/interfaces/moz.build
dom/icc/interfaces/nsIIccProvider.idl
dom/mobileconnection/MobileConnection.cpp
dom/system/gonk/RILContentHelper.js
dom/system/gonk/RILContentHelper.manifest
dom/system/gonk/RadioInterfaceLayer.js
dom/system/gonk/SystemWorkerManager.cpp
dom/system/gonk/moz.build
dom/system/gonk/nsIRadioInterfaceLayer.idl
dom/system/gonk/nsRadioInterfaceLayer.h
dom/system/gonk/tests/marionette/test_ril_code_quality.py
--- a/b2g/installer/package-manifest.in
+++ b/b2g/installer/package-manifest.in
@@ -511,18 +511,16 @@
 @RESPATH@/components/MobileConnectionService.manifest
 @RESPATH@/components/RadioInterfaceLayer.js
 @RESPATH@/components/RadioInterfaceLayer.manifest
 @RESPATH@/components/SmsService.js
 @RESPATH@/components/SmsService.manifest
 #endif
 @RESPATH@/components/StkCmdFactory.js
 @RESPATH@/components/StkCmdFactory.manifest
-@RESPATH@/components/RILContentHelper.js
-@RESPATH@/components/RILContentHelper.manifest
 @RESPATH@/components/RILSystemMessengerHelper.js
 @RESPATH@/components/RILSystemMessengerHelper.manifest
 @RESPATH@/components/TelephonyAudioService.js
 @RESPATH@/components/TelephonyAudioService.manifest
 @RESPATH@/components/USSDReceivedWrapper.js
 @RESPATH@/components/USSDReceivedWrapper.manifest
 #ifndef DISABLE_MOZ_RIL_GEOLOC
 @RESPATH@/components/TelephonyService.js
--- a/dom/icc/Icc.cpp
+++ b/dom/icc/Icc.cpp
@@ -10,21 +10,19 @@
 #include "IccContact.h"
 #include "mozilla/dom/ContactsBinding.h"
 #include "mozilla/dom/DOMRequest.h"
 #include "mozilla/dom/IccInfo.h"
 #include "mozilla/dom/MozStkCommandEvent.h"
 #include "mozilla/dom/Promise.h"
 #include "mozilla/dom/ScriptSettings.h"
 #include "nsIIccInfo.h"
-#include "nsIIccProvider.h"
 #include "nsIIccService.h"
 #include "nsIStkCmdFactory.h"
 #include "nsIStkProactiveCmd.h"
-#include "nsRadioInterfaceLayer.h"
 #include "nsServiceManagerUtils.h"
 
 using mozilla::dom::icc::IccCallback;
 using mozilla::dom::icc::IccContact;
 
 namespace mozilla {
 namespace dom {
 
--- a/dom/icc/IccListener.cpp
+++ b/dom/icc/IccListener.cpp
@@ -5,17 +5,16 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "IccListener.h"
 
 #include "Icc.h"
 #include "IccManager.h"
 #include "nsIDOMClassInfo.h"
 #include "nsIIccInfo.h"
-#include "nsRadioInterfaceLayer.h"
 
 using namespace mozilla::dom;
 
 NS_IMPL_ISUPPORTS(IccListener, nsIIccListener)
 
 IccListener::IccListener(IccManager* aIccManager, uint32_t aClientId)
   : mClientId(aClientId)
   , mIccManager(aIccManager)
--- a/dom/icc/IccListener.h
+++ b/dom/icc/IccListener.h
@@ -3,17 +3,16 @@
 /* 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 mozilla_dom_IccListener_h
 #define mozilla_dom_IccListener_h
 
 #include "nsAutoPtr.h"
-#include "nsIIccProvider.h"
 #include "nsIIccService.h"
 
 namespace mozilla {
 namespace dom {
 
 class IccManager;
 class Icc;
 
--- a/dom/icc/interfaces/moz.build
+++ b/dom/icc/interfaces/moz.build
@@ -2,17 +2,16 @@
 # vim: set filetype=python:
 # 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/.
 
 XPIDL_SOURCES += [
     'nsIIccContact.idl',
     'nsIIccInfo.idl',
-    'nsIIccProvider.idl', # TODO: Bug 815526, deprecate RILContentHelper.
     'nsIIccService.idl',
     'nsIStkCmdFactory.idl',
     'nsIStkProactiveCmd.idl',
 ]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk' and CONFIG['MOZ_B2G_RIL']:
     XPIDL_SOURCES += [
         'nsIGonkIccService.idl',
deleted file mode 100644
--- a/dom/icc/interfaces/nsIIccProvider.idl
+++ /dev/null
@@ -1,28 +0,0 @@
-/* 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/. */
-
-#include "nsISupports.idl"
-
-interface nsIDOMDOMRequest;
-interface nsIDOMWindow;
-
-/**
- * XPCOM component (in the content process) that provides the ICC information.
- */
-[scriptable, uuid(09f29ef0-006f-11e5-a0e1-fbef06958398)]
-interface nsIIccProvider : nsISupports
-{
-  /**
-   * Phonebook interfaces.
-   */
-  nsIDOMDOMRequest readContacts(in unsigned long clientId,
-                                in nsIDOMWindow window,
-                                in unsigned long contactType);
-
-  nsIDOMDOMRequest updateContact(in unsigned long clientId,
-                                 in nsIDOMWindow window,
-                                 in unsigned long contactType,
-                                 in jsval contact,
-                                 in DOMString pin2);
-};
--- a/dom/mobileconnection/MobileConnection.cpp
+++ b/dom/mobileconnection/MobileConnection.cpp
@@ -17,17 +17,16 @@
 #include "mozilla/Preferences.h"
 #include "mozilla/Services.h"
 #include "nsIDOMDOMRequest.h"
 #include "nsIIccInfo.h"
 #include "nsIPermissionManager.h"
 #include "nsIVariant.h"
 #include "nsJSON.h"
 #include "nsJSUtils.h"
-#include "nsRadioInterfaceLayer.h"
 #include "nsServiceManagerUtils.h"
 
 #define MOBILECONN_ERROR_INVALID_PARAMETER NS_LITERAL_STRING("InvalidParameter")
 #define MOBILECONN_ERROR_INVALID_PASSWORD  NS_LITERAL_STRING("InvalidPassword")
 
 #ifdef CONVERT_STRING_TO_NULLABLE_ENUM
 #undef CONVERT_STRING_TO_NULLABLE_ENUM
 #endif
deleted file mode 100644
--- a/dom/system/gonk/RILContentHelper.js
+++ /dev/null
@@ -1,340 +0,0 @@
-/* Copyright 2012 Mozilla Foundation and Mozilla contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-"use strict";
-
-const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
-
-Cu.import("resource://gre/modules/DOMRequestHelper.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-/* global RIL */
-XPCOMUtils.defineLazyGetter(this, "RIL", function () {
-  let obj = {};
-  Cu.import("resource://gre/modules/ril_consts.js", obj);
-  return obj;
-});
-
-const NS_XPCOM_SHUTDOWN_OBSERVER_ID = "xpcom-shutdown";
-
-const NS_PREFBRANCH_PREFCHANGE_TOPIC_ID = "nsPref:changed";
-
-const kPrefRilNumRadioInterfaces = "ril.numRadioInterfaces";
-const kPrefRilDebuggingEnabled = "ril.debugging.enabled";
-
-let DEBUG;
-function debug(s) {
-  dump("-*- RILContentHelper: " + s + "\n");
-}
-
-const RILCONTENTHELPER_CID =
-  Components.ID("{472816e1-1fd6-4405-996c-806f9ea68174}");
-
-const RIL_IPC_MSG_NAMES = [
-  "RIL:ReadIccContacts",
-  "RIL:UpdateIccContact",
-];
-
-/* global cpmm */
-XPCOMUtils.defineLazyServiceGetter(this, "cpmm",
-                                   "@mozilla.org/childprocessmessagemanager;1",
-                                   "nsISyncMessageSender");
-
-/* global UUIDGenerator */
-XPCOMUtils.defineLazyServiceGetter(this, "UUIDGenerator",
-                  "@mozilla.org/uuid-generator;1",
-                  "nsIUUIDGenerator");
-
-/* global gNumRadioInterfaces */
-XPCOMUtils.defineLazyGetter(this, "gNumRadioInterfaces", function() {
-  let appInfo = Cc["@mozilla.org/xre/app-info;1"];
-  let isParentProcess = !appInfo || appInfo.getService(Ci.nsIXULRuntime)
-                          .processType == Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT;
-
-  if (isParentProcess) {
-    let ril = { numRadioInterfaces: 0 };
-    try {
-      ril = Cc["@mozilla.org/ril;1"].getService(Ci.nsIRadioInterfaceLayer);
-    } catch(e) {}
-    return ril.numRadioInterfaces;
-  }
-
-  return Services.prefs.getIntPref(kPrefRilNumRadioInterfaces);
-});
-
-function RILContentHelper() {
-  this.updateDebugFlag();
-
-  this.numClients = gNumRadioInterfaces;
-  if (DEBUG) debug("Number of clients: " + this.numClients);
-
-  this.initDOMRequestHelper(/* aWindow */ null, RIL_IPC_MSG_NAMES);
-  this._windowsMap = [];
-
-  Services.obs.addObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false);
-
-  Services.prefs.addObserver(kPrefRilDebuggingEnabled, this, false);
-}
-
-RILContentHelper.prototype = {
-  __proto__: DOMRequestIpcHelper.prototype,
-
-  QueryInterface: XPCOMUtils.generateQI([Ci.nsIIccProvider,
-                                         Ci.nsIObserver,
-                                         Ci.nsISupportsWeakReference]),
-  classID:   RILCONTENTHELPER_CID,
-  classInfo: XPCOMUtils.generateCI({classID: RILCONTENTHELPER_CID,
-                                    classDescription: "RILContentHelper",
-                                    interfaces: [Ci.nsIIccProvider]}),
-
-  updateDebugFlag: function() {
-    try {
-      DEBUG = RIL.DEBUG_CONTENT_HELPER ||
-              Services.prefs.getBoolPref(kPrefRilDebuggingEnabled);
-    } catch (e) {}
-  },
-
-  _windowsMap: null,
-
-  /**
-   * nsIIccProvider
-   */
-
-  readContacts: function(clientId, window, contactType) {
-    if (window == null) {
-      throw Components.Exception("Can't get window object",
-                                  Cr.NS_ERROR_UNEXPECTED);
-    }
-
-    let request = Services.DOMRequest.createRequest(window);
-    let requestId = this.getRequestId(request);
-    this._windowsMap[requestId] = window;
-
-    cpmm.sendAsyncMessage("RIL:ReadIccContacts", {
-      clientId: clientId,
-      data: {
-        requestId: requestId,
-        contactType: contactType
-      }
-    });
-    return request;
-  },
-
-  updateContact: function(clientId, window, contactType, contact, pin2) {
-    if (window == null) {
-      throw Components.Exception("Can't get window object",
-                                  Cr.NS_ERROR_UNEXPECTED);
-    }
-
-    let request = Services.DOMRequest.createRequest(window);
-    let requestId = this.getRequestId(request);
-    this._windowsMap[requestId] = window;
-
-    // Parsing nsDOMContact to Icc Contact format
-    let iccContact = {};
-
-    if (Array.isArray(contact.name) && contact.name[0]) {
-      iccContact.alphaId = contact.name[0];
-    }
-
-    if (Array.isArray(contact.tel)) {
-      iccContact.number = contact.tel[0] && contact.tel[0].value;
-      let telArray = contact.tel.slice(1);
-      let length = telArray.length;
-      if (length > 0) {
-        iccContact.anr = [];
-      }
-      for (let i = 0; i < telArray.length; i++) {
-        iccContact.anr.push(telArray[i].value);
-      }
-    }
-
-    if (Array.isArray(contact.email) && contact.email[0]) {
-      iccContact.email = contact.email[0].value;
-    }
-
-    iccContact.contactId = contact.id;
-
-    cpmm.sendAsyncMessage("RIL:UpdateIccContact", {
-      clientId: clientId,
-      data: {
-        requestId: requestId,
-        contactType: contactType,
-        contact: iccContact,
-        pin2: pin2
-      }
-    });
-
-    return request;
-  },
-
-  // nsIObserver
-
-  observe: function(subject, topic, data) {
-    switch (topic) {
-      case NS_PREFBRANCH_PREFCHANGE_TOPIC_ID:
-        if (data == kPrefRilDebuggingEnabled) {
-          this.updateDebugFlag();
-        }
-        break;
-
-      case NS_XPCOM_SHUTDOWN_OBSERVER_ID:
-        this.destroyDOMRequestHelper();
-        Services.obs.removeObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID);
-        break;
-    }
-  },
-
-  // nsIMessageListener
-
-  fireRequestSuccess: function(requestId, result) {
-    let request = this.takeRequest(requestId);
-    if (!request) {
-      if (DEBUG) {
-        debug("not firing success for id: " + requestId +
-              ", result: " + JSON.stringify(result));
-      }
-      return;
-    }
-
-    if (DEBUG) {
-      debug("fire request success, id: " + requestId +
-            ", result: " + JSON.stringify(result));
-    }
-    Services.DOMRequest.fireSuccess(request, result);
-  },
-
-  dispatchFireRequestSuccess: function(requestId, result) {
-    let currentThread = Services.tm.currentThread;
-
-    currentThread.dispatch(this.fireRequestSuccess.bind(this, requestId, result),
-                           Ci.nsIThread.DISPATCH_NORMAL);
-  },
-
-  fireRequestError: function(requestId, error) {
-    let request = this.takeRequest(requestId);
-    if (!request) {
-      if (DEBUG) {
-        debug("not firing error for id: " + requestId +
-              ", error: " + JSON.stringify(error));
-      }
-      return;
-    }
-
-    if (DEBUG) {
-      debug("fire request error, id: " + requestId +
-            ", result: " + JSON.stringify(error));
-    }
-    Services.DOMRequest.fireError(request, error);
-  },
-
-  dispatchFireRequestError: function(requestId, error) {
-    let currentThread = Services.tm.currentThread;
-
-    currentThread.dispatch(this.fireRequestError.bind(this, requestId, error),
-                           Ci.nsIThread.DISPATCH_NORMAL);
-  },
-
-  fireRequestDetailedError: function(requestId, detailedError) {
-    let request = this.takeRequest(requestId);
-    if (!request) {
-      if (DEBUG) {
-        debug("not firing detailed error for id: " + requestId +
-              ", detailedError: " + JSON.stringify(detailedError));
-      }
-      return;
-    }
-
-    Services.DOMRequest.fireDetailedError(request, detailedError);
-  },
-
-  receiveMessage: function(msg) {
-    let request;
-    if (DEBUG) {
-      debug("Received message '" + msg.name + "': " + JSON.stringify(msg.json));
-    }
-
-    let data = msg.json.data;
-    let clientId = msg.json.clientId;
-    switch (msg.name) {
-      case "RIL:ReadIccContacts":
-        this.handleReadIccContacts(data);
-        break;
-      case "RIL:UpdateIccContact":
-        this.handleUpdateIccContact(data);
-        break;
-    }
-  },
-
-  handleReadIccContacts: function(message) {
-    if (message.errorMsg) {
-      this.fireRequestError(message.requestId, message.errorMsg);
-      return;
-    }
-
-    let window = this._windowsMap[message.requestId];
-    delete this._windowsMap[message.requestId];
-    let contacts = message.contacts;
-    let result = new window.Array();
-    contacts.forEach(function(c) {
-      let prop = {name: [c.alphaId], tel: [{value: c.number}]};
-
-      if (c.email) {
-        prop.email = [{value: c.email}];
-      }
-
-      // ANR - Additional Number
-      let anrLen = c.anr ? c.anr.length : 0;
-      for (let i = 0; i < anrLen; i++) {
-        prop.tel.push({value: c.anr[i]});
-      }
-
-      let contact = new window.mozContact(prop);
-      contact.id = c.contactId;
-      result.push(contact);
-    });
-
-    this.fireRequestSuccess(message.requestId, result);
-  },
-
-  handleUpdateIccContact: function(message) {
-    if (message.errorMsg) {
-      this.fireRequestError(message.requestId, message.errorMsg);
-      return;
-    }
-
-    let window = this._windowsMap[message.requestId];
-    delete this._windowsMap[message.requestId];
-    let iccContact = message.contact;
-    let prop = {name: [iccContact.alphaId], tel: [{value: iccContact.number}]};
-    if (iccContact.email) {
-      prop.email = [{value: iccContact.email}];
-    }
-
-    // ANR - Additional Number
-    let anrLen = iccContact.anr ? iccContact.anr.length : 0;
-    for (let i = 0; i < anrLen; i++) {
-      prop.tel.push({value: iccContact.anr[i]});
-    }
-
-    let contact = new window.mozContact(prop);
-    contact.id = iccContact.contactId;
-
-    this.fireRequestSuccess(message.requestId, contact);
-  }
-};
-
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([RILContentHelper]);
deleted file mode 100644
--- a/dom/system/gonk/RILContentHelper.manifest
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright 2012 Mozilla Foundation and Mozilla contributors
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# RILContentHelper.js
-# TODO: Bug 815526, deprecate RILContentHelper:
-#       To be removed from b2g/installer/package-manifest.in as well.
-component {472816e1-1fd6-4405-996c-806f9ea68174} RILContentHelper.js
-contract @mozilla.org/ril/content-helper;1 {472816e1-1fd6-4405-996c-806f9ea68174}
-category profile-after-change RILContentHelper @mozilla.org/ril/content-helper;1
--- a/dom/system/gonk/RadioInterfaceLayer.js
+++ b/dom/system/gonk/RadioInterfaceLayer.js
@@ -58,22 +58,16 @@ const kPrefRilNumRadioInterfaces = "ril.
 const kPrefRilDebuggingEnabled = "ril.debugging.enabled";
 
 const RADIO_POWER_OFF_TIMEOUT = 30000;
 const HW_DEFAULT_CLIENT_ID = 0;
 
 const NETWORK_TYPE_WIFI        = Ci.nsINetworkInterface.NETWORK_TYPE_WIFI;
 const NETWORK_TYPE_MOBILE      = Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE;
 
-// TODO: Bug 815526, deprecate RILContentHelper.
-const RIL_IPC_ICCMANAGER_MSG_NAMES = [
-  "RIL:ReadIccContacts",
-  "RIL:UpdateIccContact",
-];
-
 // set to true in ril_consts.js to see debug messages
 var DEBUG = RIL.DEBUG_RIL;
 
 function updateDebugFlag() {
   // Read debug setting from pref
   let debugPref;
   try {
     debugPref = Services.prefs.getBoolPref(kPrefRilDebuggingEnabled);
@@ -139,214 +133,16 @@ XPCOMUtils.defineLazyServiceGetter(this,
 XPCOMUtils.defineLazyServiceGetter(this, "gDataCallInterfaceService",
                                    "@mozilla.org/datacall/interfaceservice;1",
                                    "nsIGonkDataCallInterfaceService");
 
 XPCOMUtils.defineLazyServiceGetter(this, "gStkCmdFactory",
                                    "@mozilla.org/icc/stkcmdfactory;1",
                                    "nsIStkCmdFactory");
 
-// TODO: Bug 815526, deprecate RILContentHelper.
-XPCOMUtils.defineLazyGetter(this, "gMessageManager", function() {
-  return {
-    QueryInterface: XPCOMUtils.generateQI([Ci.nsIMessageListener,
-                                           Ci.nsIObserver]),
-
-    ril: null,
-
-    // Manage message targets in terms of topic. Only the authorized and
-    // registered contents can receive related messages.
-    targetsByTopic: {},
-    topics: [],
-
-    targetMessageQueue: [],
-    ready: false,
-
-    init: function(ril) {
-      this.ril = ril;
-
-      Services.obs.addObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false);
-      Services.obs.addObserver(this, kSysMsgListenerReadyObserverTopic, false);
-      this._registerMessageListeners();
-    },
-
-    _shutdown: function() {
-      this.ril = null;
-
-      Services.obs.removeObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID);
-      this._unregisterMessageListeners();
-    },
-
-    _registerMessageListeners: function() {
-      ppmm.addMessageListener("child-process-shutdown", this);
-      for (let msgName of RIL_IPC_ICCMANAGER_MSG_NAMES) {
-        ppmm.addMessageListener(msgName, this);
-      }
-    },
-
-    _unregisterMessageListeners: function() {
-      ppmm.removeMessageListener("child-process-shutdown", this);
-      for (let msgName of RIL_IPC_ICCMANAGER_MSG_NAMES) {
-        ppmm.removeMessageListener(msgName, this);
-      }
-      ppmm = null;
-    },
-
-    _registerMessageTarget: function(topic, target) {
-      let targets = this.targetsByTopic[topic];
-      if (!targets) {
-        targets = this.targetsByTopic[topic] = [];
-        let list = this.topics;
-        if (list.indexOf(topic) == -1) {
-          list.push(topic);
-        }
-      }
-
-      if (targets.indexOf(target) != -1) {
-        if (DEBUG) debug("Already registered this target!");
-        return;
-      }
-
-      targets.push(target);
-      if (DEBUG) debug("Registered " + topic + " target: " + target);
-    },
-
-    _unregisterMessageTarget: function(topic, target) {
-      if (topic == null) {
-        // Unregister the target for every topic when no topic is specified.
-        for (let type of this.topics) {
-          this._unregisterMessageTarget(type, target);
-        }
-        return;
-      }
-
-      // Unregister the target for a specified topic.
-      let targets = this.targetsByTopic[topic];
-      if (!targets) {
-        return;
-      }
-
-      let index = targets.indexOf(target);
-      if (index != -1) {
-        targets.splice(index, 1);
-        if (DEBUG) debug("Unregistered " + topic + " target: " + target);
-      }
-    },
-
-    _enqueueTargetMessage: function(topic, message, options) {
-      let msg = { topic : topic,
-                  message : message,
-                  options : options };
-      // Remove previous queued message with the same message type and client Id
-      // , only one message per (message type + client Id) is allowed in queue.
-      let messageQueue = this.targetMessageQueue;
-      for(let i = 0; i < messageQueue.length; i++) {
-        if (messageQueue[i].message === message &&
-            messageQueue[i].options.clientId === options.clientId) {
-          messageQueue.splice(i, 1);
-          break;
-        }
-      }
-
-      messageQueue.push(msg);
-    },
-
-    _sendTargetMessage: function(topic, message, options) {
-      if (!this.ready) {
-        this._enqueueTargetMessage(topic, message, options);
-        return;
-      }
-
-      let targets = this.targetsByTopic[topic];
-      if (!targets) {
-        return;
-      }
-
-      for (let target of targets) {
-        target.sendAsyncMessage(message, options);
-      }
-    },
-
-    _resendQueuedTargetMessage: function() {
-      this.ready = true;
-
-      // Here uses this._sendTargetMessage() to resend message, which will
-      // enqueue message if listener is not ready.
-      // So only resend after listener is ready, or it will cause infinate loop and
-      // hang the system.
-
-      // Dequeue and resend messages.
-      for each (let msg in this.targetMessageQueue) {
-        this._sendTargetMessage(msg.topic, msg.message, msg.options);
-      }
-      this.targetMessageQueue = null;
-    },
-
-    /**
-     * nsIMessageListener interface methods.
-     */
-
-    receiveMessage: function(msg) {
-      if (DEBUG) debug("Received '" + msg.name + "' message from content process");
-      if (msg.name == "child-process-shutdown") {
-        // By the time we receive child-process-shutdown, the child process has
-        // already forgotten its permissions so we need to unregister the target
-        // for every permission.
-        this._unregisterMessageTarget(null, msg.target);
-        return null;
-      }
-
-      if (RIL_IPC_ICCMANAGER_MSG_NAMES.indexOf(msg.name) != -1) {
-        if (!msg.target.assertPermission("mobileconnection")) {
-          if (DEBUG) {
-            debug("IccManager message " + msg.name +
-                  " from a content process with no 'mobileconnection' privileges.");
-          }
-          return null;
-        }
-      } else {
-        if (DEBUG) debug("Ignoring unknown message type: " + msg.name);
-        return null;
-      }
-
-      let clientId = msg.json.clientId || 0;
-      let radioInterface = this.ril.getRadioInterface(clientId);
-      if (!radioInterface) {
-        if (DEBUG) debug("No such radio interface: " + clientId);
-        return null;
-      }
-
-      return radioInterface.receiveMessage(msg);
-    },
-
-    /**
-     * nsIObserver interface methods.
-     */
-
-    observe: function(subject, topic, data) {
-      switch (topic) {
-        case kSysMsgListenerReadyObserverTopic:
-          Services.obs.removeObserver(this, kSysMsgListenerReadyObserverTopic);
-          this._resendQueuedTargetMessage();
-          break;
-        case NS_XPCOM_SHUTDOWN_OBSERVER_ID:
-          this._shutdown();
-          break;
-      }
-    },
-
-    sendIccMessage: function(message, clientId, data) {
-      this._sendTargetMessage("icc", message, {
-        clientId: clientId,
-        data: data
-      });
-    }
-  };
-});
-
 XPCOMUtils.defineLazyGetter(this, "gRadioEnabledController", function() {
   let _ril = null;
   let _pendingMessages = [];  // For queueing "setRadioEnabled" message.
   let _isProcessingPending = false;
   let _timer = null;
   let _request = null;
   let _deactivatingDeferred = {};
   let _initializedCardState = {};
@@ -609,17 +405,16 @@ function RadioInterfaceLayer() {
   this.radioInterfaces = [];
   for (let clientId = 0; clientId < numIfaces; clientId++) {
     this.radioInterfaces.push(new RadioInterface(clientId, workerMessenger));
   }
 
   Services.obs.addObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false);
   Services.prefs.addObserver(kPrefRilDebuggingEnabled, this, false);
 
-  gMessageManager.init(this); // TODO: Bug 815526, deprecate RILContentHelper.
   gRadioEnabledController.init(this);
 }
 RadioInterfaceLayer.prototype = {
 
   classID:   RADIOINTERFACELAYER_CID,
   classInfo: XPCOMUtils.generateCI({classID: RADIOINTERFACELAYER_CID,
                                     classDescription: "RadioInterfaceLayer",
                                     interfaces: [Ci.nsIRadioInterfaceLayer]}),
@@ -836,49 +631,23 @@ WorkerMessenger.prototype = {
       // For sending a request that never replied at all, we're fine with this
       // because no callback shall be passed and we leave nothing to be cleaned
       // up later.
       this.tokenCallbackMap[message.rilMessageToken] = callback;
     }
 
     message.rilMessageType = rilMessageType;
     this.worker.postMessage(message);
-  },
-
-  /**
-   * Send message to worker and return worker reply to RILContentHelper.
-   *
-   * @param msg
-   *        A message object from ppmm.
-   * @param rilMessageType
-   *        A text string for worker message type.
-   * @param ipcType [optinal]
-   *        A text string for ipc message type. "msg.name" if omitted.
-   *
-   * @TODO: Bug 815526 - deprecate RILContentHelper.
-   */
-  sendWithIPCMessage: function(clientId, msg, rilMessageType, ipcType) {
-    this.send(clientId, rilMessageType, msg.json.data, (function(reply) {
-      ipcType = ipcType || msg.name;
-      msg.target.sendAsyncMessage(ipcType, {
-        clientId: clientId,
-        data: reply
-      });
-      return false;
-    }).bind(this));
   }
 };
 
 function RadioInterface(aClientId, aWorkerMessenger) {
   this.clientId = aClientId;
   this.workerMessenger = {
-    send: aWorkerMessenger.send.bind(aWorkerMessenger, aClientId),
-    // TODO: Bug 815526, deprecate RILContentHelper.
-    sendWithIPCMessage:
-      aWorkerMessenger.sendWithIPCMessage.bind(aWorkerMessenger, aClientId),
+    send: aWorkerMessenger.send.bind(aWorkerMessenger, aClientId)
   };
   aWorkerMessenger.registerClient(aClientId, this);
 
   this.operatorInfo = {};
 
   let lock = gSettingsService.createLock();
 
   // Read the "time.clock.automatic-update.enabled" setting to see if
@@ -936,33 +705,16 @@ RadioInterface.prototype = {
 
   isCardPresent: function() {
     let icc = gIccService.getIccByServiceId(this.clientId);
     let cardState = icc ? icc.cardState : Ci.nsIIcc.CARD_STATE_UNKNOWN;
     return cardState !== Ci.nsIIcc.CARD_STATE_UNDETECTED &&
       cardState !== Ci.nsIIcc.CARD_STATE_UNKNOWN;
   },
 
-  /**
-   * Process a message from the content process.
-   *
-   * TODO: Bug 815526, deprecate RILContentHelper
-   */
-  receiveMessage: function(msg) {
-    switch (msg.name) {
-      case "RIL:ReadIccContacts":
-        this.workerMessenger.sendWithIPCMessage(msg, "readICCContacts");
-        break;
-      case "RIL:UpdateIccContact":
-        this.workerMessenger.sendWithIPCMessage(msg, "updateICCContact");
-        break;
-    }
-    return null;
-  },
-
   handleUnsolicitedWorkerMessage: function(message) {
     switch (message.rilMessageType) {
       case "callRing":
         gTelephonyService.notifyCallRing();
         break;
       case "currentCalls":
         gTelephonyService.notifyCurrentCalls(this.clientId, message.calls);
         break;
--- a/dom/system/gonk/SystemWorkerManager.cpp
+++ b/dom/system/gonk/SystemWorkerManager.cpp
@@ -30,17 +30,16 @@
 #include "mozilla/dom/ScriptSettings.h"
 #ifdef MOZ_B2G_RIL
 #include "mozilla/ipc/Ril.h"
 #endif
 #include "mozilla/ipc/KeyStore.h"
 #include "nsIObserverService.h"
 #include "nsServiceManagerUtils.h"
 #include "nsThreadUtils.h"
-#include "nsRadioInterfaceLayer.h"
 #include "WifiWorker.h"
 #include "mozilla/Services.h"
 
 USING_WORKERS_NAMESPACE
 
 using namespace mozilla::dom::gonk;
 using namespace mozilla::ipc;
 using namespace mozilla::system;
--- a/dom/system/gonk/moz.build
+++ b/dom/system/gonk/moz.build
@@ -89,18 +89,16 @@ if CONFIG['MOZ_B2G_RIL']:
         'nsIDataCallInterfaceService.idl',
         'nsIDataCallManager.idl',
         'nsIGonkDataCallInterfaceService.idl',
         'nsIRadioInterfaceLayer.idl',
     ]
     EXTRA_COMPONENTS += [
         'DataCallManager.js',
         'DataCallManager.manifest',
-        'RILContentHelper.js', # TODO: Bug 815526, deprecate RILContentHelper.
-        'RILContentHelper.manifest', # TODO: Bug 815526, deprecate RILContentHelper.
         'RILSystemMessengerHelper.js',
         'RILSystemMessengerHelper.manifest',
     ]
     EXTRA_JS_MODULES += [
         'ril_consts.js',
         'ril_worker.js',
         'ril_worker_buf_object.js',
         'ril_worker_telephony_request_queue.js',
--- a/dom/system/gonk/nsIRadioInterfaceLayer.idl
+++ b/dom/system/gonk/nsIRadioInterfaceLayer.idl
@@ -30,16 +30,23 @@ interface nsIRadioInterface : nsISupport
 
   void updateRILNetworkInterface();
 
   void sendWorkerMessage(in DOMString type,
               [optional] in jsval message,
               [optional] in nsIRilSendWorkerMessageCallback callback);
 };
 
+%{C++
+#define NS_RADIOINTERFACELAYER_CID \
+    { 0x2d831c8d, 0x6017, 0x435b, \
+      { 0xa8, 0x0c, 0xe5, 0xd4, 0x22, 0x81, 0x0c, 0xea } }
+#define NS_RADIOINTERFACELAYER_CONTRACTID "@mozilla.org/ril;1"
+%}
+
 [scriptable, uuid(78b65e8c-68e7-4510-9a05-65bba12b283e)]
 interface nsIRadioInterfaceLayer : nsISupports
 {
   readonly attribute unsigned long numRadioInterfaces;
 
   nsIRadioInterface getRadioInterface(in unsigned long clientId);
 
   /**
deleted file mode 100644
--- a/dom/system/gonk/nsRadioInterfaceLayer.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/* 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/. */
-
-// These must always match the values given in RadioInterfaceLayer.manifest!
-
-#define NS_RADIOINTERFACELAYER_CID \
-    { 0x2d831c8d, 0x6017, 0x435b, \
-      { 0xa8, 0x0c, 0xe5, 0xd4, 0x22, 0x81, 0x0c, 0xea } }
-
-#define NS_RILCONTENTHELPER_CID \
-    { 0x472816e1, 0x1fd6, 0x4405, \
-      { 0x99, 0x6c, 0x80, 0x6f, 0x9e, 0xa6, 0x81, 0x74 } }
-
-#define NS_RADIOINTERFACELAYER_CONTRACTID "@mozilla.org/ril;1"
-#define NS_RILCONTENTHELPER_CONTRACTID "@mozilla.org/ril/content-helper;1"
--- a/dom/system/gonk/tests/marionette/test_ril_code_quality.py
+++ b/dom/system/gonk/tests/marionette/test_ril_code_quality.py
@@ -1,13 +1,12 @@
 """
 The test performs the static code analysis check by JSHint.
 
 Target js files:
-- RILContentHelper.js TODO: Bug 815526, deprecate RILContentHelper.
 - RadioInterfaceLayer.js
 - ril_worker.js
 - ril_consts.js
 
 If the js file contains the line of 'importScript()' (Ex: ril_worker.js), the
 test will perform a special merge step before excuting JSHint.
 
 Ex: Script A
@@ -95,17 +94,16 @@ class StringUtility:
 
 
 class ResourceUriFileReader:
 
     """Handle the process of reading the source code from system."""
 
     URI_PREFIX = 'resource://gre/'
     URI_PATH = {
-        'RILContentHelper.js':    'components/RILContentHelper.js', #TODO: Bug 815526, deprecate RILContentHelper.
         'RadioInterfaceLayer.js': 'components/RadioInterfaceLayer.js',
         'ril_worker.js':          'modules/ril_worker.js',
         'ril_consts.js':          'modules/ril_consts.js',
         'systemlibs.js':          'modules/systemlibs.js',
         'worker_buf.js':          'modules/workers/worker_buf.js',
     }
 
     CODE_OPEN_CHANNEL_BY_URI = '''
@@ -353,20 +351,16 @@ class TestRILCodeQuality(MarionetteTestC
             JSHintEngine(self.marionette,
                          self._read_local_file(self.JSHINT_PATH),
                          self._read_local_file(self.JSHINTRC_PATH)),
             self._get_extended_error_message)
 
     def tearDown(self):
         MarionetteTestCase.tearDown(self)
 
-    # TODO: Bug 815526, deprecate RILContentHelper.
-    def test_RILContentHelper(self):
-        self._check('RILContentHelper.js')
-
     def test_RadioInterfaceLayer(self):
         self._check('RadioInterfaceLayer.js')
 
     # Bug 936504. Disable the test for 'ril_worker.js'. It sometimes runs very
     # slow and causes the timeout fail on try server.
     #def test_ril_worker(self):
     #    self._check('ril_worker.js')