Bug 960894 - 3.d.2/4: use 'this.context.clientId'. r=hsinyi
authorVicamo Yang <vyang@mozilla.com>
Mon, 17 Feb 2014 19:35:08 +0800
changeset 169142 2cdf076eb83313bedb454540da1c41b90464de24
parent 169141 9d60d4e854a3b73498f98b87a2279ff46445a823
child 169143 3d9787c9123497746e58441d416df870bc2a82e8
push id26234
push userphilringnalda@gmail.com
push dateMon, 17 Feb 2014 23:16:21 +0000
treeherdermozilla-central@6b6450d3fbf0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershsinyi
bugs960894
milestone30.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 960894 - 3.d.2/4: use 'this.context.clientId'. r=hsinyi
dom/system/gonk/ril_worker.js
--- a/dom/system/gonk/ril_worker.js
+++ b/dom/system/gonk/ril_worker.js
@@ -38,23 +38,23 @@
 
 "use strict";
 
 importScripts("ril_consts.js");
 importScripts("resource://gre/modules/workers/require.js");
 
 // set to true in ril_consts.js to see debug messages
 let DEBUG = DEBUG_WORKER;
-let CLIENT_ID = -1;
+let clientId = -1;
 let GLOBAL = this;
 
 if (!this.debug) {
   // Debugging stub that goes nowhere.
   this.debug = function debug(message) {
-    dump("RIL Worker[" + CLIENT_ID + "]: " + message + "\n");
+    dump("RIL Worker[" + clientId + "]: " + message + "\n");
   };
 }
 
 let RIL_CELLBROADCAST_DISABLED;
 let RIL_CLIR_MODE;
 let RIL_EMERGENCY_NUMBERS;
 const DEFAULT_EMERGENCY_NUMBERS = ["112", "911"];
 
@@ -180,17 +180,17 @@ BufObject.prototype = {
   },
 
   simpleRequest: function(type, options) {
     this.newParcel(type, options);
     this.sendParcel();
   },
 
   onSendParcel: function(parcel) {
-    postRILMessage(CLIENT_ID, parcel);
+    postRILMessage(this.context.clientId, parcel);
   }
 };
 
 (function() {
   let base = require("resource://gre/modules/workers/worker_buf.js").Buf;
   for (let p in base) {
     BufObject.prototype[p] = base[p];
   }
@@ -5046,17 +5046,17 @@ RilObject.prototype = {
       this.context.StkCommandParamsFactory.createParam(cmdDetails, ctlvs);
     this.sendChromeMessage(cmdDetails);
   },
 
   /**
    * Send messages to the main thread.
    */
   sendChromeMessage: function(message) {
-    message.rilMessageClientId = CLIENT_ID;
+    message.rilMessageClientId = this.context.clientId;
     postMessage(message);
   },
 
   /**
    * Handle incoming requests from the RIL. We find the method that
    * corresponds to the request type. Incidentally, the request type
    * _is_ the method name, so that's easy.
    */
@@ -5082,17 +5082,17 @@ RilObject.prototype = {
     RILQUIRKS_SIM_APP_STATE_EXTRA_FIELDS = quirks.simAppStateExtraFields;
     RILQUIRKS_EXTRA_UINT32_2ND_CALL = quirks.extraUint2ndCall;
     RILQUIRKS_HAVE_QUERY_ICC_LOCK_RETRY_COUNT = quirks.haveQueryIccLockRetryCount;
     RILQUIRKS_SEND_STK_PROFILE_DOWNLOAD = quirks.sendStkProfileDownload;
     RILQUIRKS_DATA_REGISTRATION_ON_DEMAND = quirks.dataRegistrationOnDemand;
   },
 
   registerClient: function(aOptions) {
-    CLIENT_ID = aOptions.clientId;
+    this.context.clientId = aOptions.clientId;
 
     // Init properties that are only initialized once.
     this.v5Legacy = RILQUIRKS_V5_LEGACY;
     this.cellBroadcastDisabled = RIL_CELLBROADCAST_DISABLED;
     this.clirMode = RIL_CLIR_MODE;
 
     this.initRILState();
   }