Bug 806829 - Signaling - remove g_deviceInfo.name r=jesup
authorEthan Hugg <ethanhugg@gmail.com>
Fri, 14 Dec 2012 13:43:06 -0800
changeset 125522 ce156ff6dfdedc480993df3e0ada52aa26da3ef0
parent 125521 d2ee611a3e2362105784134ce1a6704ade3fc5ea
child 125523 d3d48381d3240a52ce2092ca17c2cb00f74d26df
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs806829
milestone20.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 806829 - Signaling - remove g_deviceInfo.name r=jesup
media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_device.c
media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_device_info.c
media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_snapshot.c
media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_snapshot.h
--- a/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_device.c
+++ b/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_device.c
@@ -43,20 +43,16 @@ cc_device_handle_t CCAPI_Device_getDevic
  * @return cc_deviceinfo_ref_t - reference handle of the device
  */
 cc_deviceinfo_ref_t CCAPI_Device_getDeviceInfo(cc_device_handle_t handle)
 {
   cc_device_info_t *device_info = (cc_device_info_t*)cpr_malloc(sizeof(cc_device_info_t));
 
   if (device_info) {
      *device_info = g_deviceInfo;
-      device_info->name  = strlib_copy(g_deviceInfo.name);
-      if (device_info->name == NULL) {
-          device_info->name  = strlib_empty();
-      }
       device_info->not_prompt  = strlib_copy(g_deviceInfo.not_prompt);
       if (device_info->not_prompt == NULL) {
           device_info->not_prompt = strlib_empty();
       }
       device_info->ref_count = 1;
   }
   return device_info;
 }
@@ -91,17 +87,16 @@ void CCAPI_Device_configUpdate(cc_device
  * @return void
  */
 void CCAPI_Device_releaseDeviceInfo(cc_deviceinfo_ref_t ref){
     cc_device_info_t *device_info = ref;
 
     if (device_info) {
        device_info->ref_count--;
        if ( device_info->ref_count == 0 ) {
-            strlib_free(device_info->name);
             strlib_free(device_info->not_prompt);
             cpr_free(device_info);
         }
     }
 }
 
 
 /**
--- a/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_device_info.c
+++ b/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_device_info.c
@@ -7,17 +7,19 @@
 #include "ccapi_snapshot.h"
 #include "ccapi_device_info.h"
 #include "sessionHash.h"
 #include "CCProvider.h"
 #include "phone_debug.h"
 #include "ccapi_snapshot.h"
 #include "ccapi_device_info.h"
 #include "util_string.h"
+#include "CSFLog.h"
 
+static const char* logTag = "ccapi_device_info";
 
 /**
  * gets the device name
  * @returns - a pointer to the device name
  */
 cc_deviceinfo_ref_t CCAPI_DeviceInfo_getDeviceHandle ()
 {
    static const char *fname="CCAPI_DeviceInfo_getDeviceHandle";
@@ -27,25 +29,17 @@ cc_deviceinfo_ref_t CCAPI_DeviceInfo_get
 }
 
 /**
  * gets the device name
  * @returns - a pointer to the device name
  */
 cc_string_t CCAPI_DeviceInfo_getDeviceName (cc_deviceinfo_ref_t handle)
 {
-  static const char *fname="CCAPI_DeviceInfo_getDeviceName";
-  cc_device_info_t *device = handle;
-  CCAPP_DEBUG(DEB_F_PREFIX"Entering\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname));
-
-  if ( device != NULL ) {
-     CCAPP_DEBUG(DEB_F_PREFIX"returned %s\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname), device->name);
-     return device->name;
-  }
-
+  CSFLogDebug(logTag, "Call to deprecated function %s, returning empty string", __FUNCTION__);
   return strlib_empty();
 }
 
 /**
  * gets the device idle status
  * @param [in] handle - reference to device info
  * @returns boolean - idle status
  */
--- a/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_snapshot.c
+++ b/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_snapshot.c
@@ -321,19 +321,16 @@ cc_feature_info_t* ccsnap_getFeatureInfo
 
 /**
  * Release any used mem to avoid a leak.
  */
 void ccsnap_device_pre_init () {
     int i = 0;
 
     CCAPP_DEBUG(DEB_F_PREFIX"Entering device_pre_init to clear it out to avoid mem leaks\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, "ccsnap_device_pre_init"));
-    if ((g_deviceInfo.name) && (strlen(g_deviceInfo.name) > 0)) {
-        strlib_free(g_deviceInfo.name);
-    }
     if ((g_deviceInfo.not_prompt) && (strlen(g_deviceInfo.not_prompt) > 0)) {
         strlib_free(g_deviceInfo.not_prompt);
     }
 
     i = 0;
     while (i < CCAPI_MAX_SERVERS) {
         if ((g_deviceInfo.ucm[i].name) &&
             (strlen(g_deviceInfo.ucm[i].name) > 0)) {
@@ -345,17 +342,16 @@ void ccsnap_device_pre_init () {
 
 void ccsnap_device_init() {
    char temp[MAX_SIP_URL_LENGTH];
 
    /* clean up structure if need be */
    ccsnap_device_pre_init();
 
    memset (&g_deviceInfo, 0, sizeof(g_deviceInfo));
-   g_deviceInfo.name =strlib_empty();
    g_deviceInfo.not_prompt =strlib_empty();
 
    g_deviceInfo.not_prompt_prio = 0;
    g_deviceInfo.not_prompt_prog = 0;
    g_deviceInfo.mwi_lamp = FALSE;
    g_deviceInfo.cucm_mode = CC_MODE_CCM;
    g_deviceInfo.ins_state = CC_STATE_IDLE;
    g_deviceInfo.ins_cause = CC_CAUSE_NONE;
@@ -397,17 +393,16 @@ void ccsnap_gen_deviceEvent(ccapi_device
               CCAPP_DEBUG(DEB_F_PREFIX"data->not_prompt=%s \n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname), device_info->not_prompt);
               CCAPP_DEBUG(DEB_F_PREFIX"data->not_prompt_prio=%d \n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname), device_info->not_prompt_prio);
               CCAPP_DEBUG(DEB_F_PREFIX"data->not_prompt_prog=%d \n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname), device_info->not_prompt_prog);
               break;
             case CCAPI_DEVICE_EV_STATE:
               CCAPP_DEBUG(DEB_F_PREFIX"setting property %s to %s\n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname), "FullyRegistered", ((device_info->ins_state == CC_STATE_INS) ? "1" : "0"));
               //intentional follow through to let the debugs get printed.
             default:
-              CCAPP_DEBUG(DEB_F_PREFIX"data->name=%s \n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname), device_info->name);
               CCAPP_DEBUG(DEB_F_PREFIX"data->mwi_lamp=%d \n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname), device_info->mwi_lamp);
               CCAPP_DEBUG(DEB_F_PREFIX"data->ins_state=%02X \n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname), device_info->ins_state);
               CCAPP_DEBUG(DEB_F_PREFIX"data->cucm_mode=%02X \n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname), device_info->cucm_mode);
               CCAPP_DEBUG(DEB_F_PREFIX"data->ins_cause=%02X \n", DEB_F_PREFIX_ARGS(SIP_CC_PROV, fname), device_info->ins_cause);
               break;
 
         }
 
--- a/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_snapshot.h
+++ b/media/webrtc/signaling/src/sipcc/core/ccapp/ccapi_snapshot.h
@@ -58,17 +58,16 @@ typedef struct cc_feature_info_t_ {
 typedef struct cc_call_server_t_ {
   cc_string_t     name;
   cc_ccm_status_t status;
   cc_int32_t      type;
 } cc_call_server_t;
 
 typedef struct cc_device_info_t_ {
   cc_uint32_t     ref_count;
-  cc_string_t     name;
   cc_string_t     not_prompt;
   char            registration_ip_addr[MAX_IPADDR_STR_LEN];
   cc_int32_t      not_prompt_prio;
   cc_boolean      not_prompt_prog;
   cc_boolean      mwi_lamp;
   cc_cucm_mode_t  cucm_mode;
   cc_service_state_t  ins_state;
   cc_service_cause_t  ins_cause;