Bug 1444129, part 2 - Rename fields of XPTInterfaceDirectoryEntry. r=njn draft
authorAndrew McCreight <continuation@gmail.com>
Wed, 07 Mar 2018 13:37:08 -0800
changeset 765073 5f717c9a001cf693f3a0eda07ef7fbc9a2683905
parent 765072 eef3f52976d6daeff8392004a83441626428a7dd
child 765074 2a7078666b144ba6fd35ac3e6cf7647ebb2d38d2
push id101960
push userbmo:continuation@gmail.com
push dateThu, 08 Mar 2018 23:46:50 +0000
reviewersnjn
bugs1444129
milestone60.0a1
Bug 1444129, part 2 - Rename fields of XPTInterfaceDirectoryEntry. r=njn MozReview-Commit-ID: 8bGFwMyzhTx
xpcom/reflect/xptinfo/xptiInterfaceInfoManager.cpp
xpcom/reflect/xptinfo/xptiTypelibGuts.cpp
xpcom/typelib/xpt/xpt_struct.cpp
xpcom/typelib/xpt/xpt_struct.h
--- a/xpcom/reflect/xptinfo/xptiInterfaceInfoManager.cpp
+++ b/xpcom/reflect/xptinfo/xptiInterfaceInfoManager.cpp
@@ -129,50 +129,50 @@ XPTInterfaceInfoManager::RegisterXPTHead
         VerifyAndAddEntryIfNew(aHeader->mInterfaceDirectory + k, k, typelib);
 }
 
 void
 XPTInterfaceInfoManager::VerifyAndAddEntryIfNew(const XPTInterfaceDirectoryEntry* iface,
                                                 uint16_t idx,
                                                 xptiTypelibGuts* typelib)
 {
-    if (!iface->interface_descriptor)
+    if (!iface->mInterfaceDescriptor)
         return;
 
     // The number of maximum methods is not arbitrary. It is the same value as
     // in xpcom/reflect/xptcall/genstubs.pl; do not change this value
     // without changing that one or you WILL see problems.
-    if (iface->interface_descriptor->num_methods > 250 &&
-            !iface->interface_descriptor->IsBuiltinClass()) {
+    if (iface->mInterfaceDescriptor->num_methods > 250 &&
+            !iface->mInterfaceDescriptor->IsBuiltinClass()) {
         NS_ASSERTION(0, "Too many methods to handle for the stub, cannot load");
-        fprintf(stderr, "ignoring too large interface: %s\n", iface->name);
+        fprintf(stderr, "ignoring too large interface: %s\n", iface->mName);
         return;
     }
 
     mWorkingSet.mTableReentrantMonitor.AssertCurrentThreadIn();
-    xptiInterfaceEntry* entry = mWorkingSet.mIIDTable.Get(iface->iid);
+    xptiInterfaceEntry* entry = mWorkingSet.mIIDTable.Get(iface->mIID);
     if (entry) {
         // XXX validate this info to find possible inconsistencies
         return;
     }
 
     // Build a new xptiInterfaceEntry object and hook it up.
 
-    entry = xptiInterfaceEntry::Create(iface->name,
-                                       iface->iid,
-                                       iface->interface_descriptor,
+    entry = xptiInterfaceEntry::Create(iface->mName,
+                                       iface->mIID,
+                                       iface->mInterfaceDescriptor,
                                        typelib);
     if (!entry)
         return;
 
     //XXX  We should SetHeader too as part of the validation, no?
-    entry->SetScriptableFlag(iface->interface_descriptor->IsScriptable());
-    entry->SetBuiltinClassFlag(iface->interface_descriptor->IsBuiltinClass());
+    entry->SetScriptableFlag(iface->mInterfaceDescriptor->IsScriptable());
+    entry->SetBuiltinClassFlag(iface->mInterfaceDescriptor->IsBuiltinClass());
     entry->SetMainProcessScriptableOnlyFlag(
-      iface->interface_descriptor->IsMainProcessScriptableOnly());
+      iface->mInterfaceDescriptor->IsMainProcessScriptableOnly());
 
     mWorkingSet.mIIDTable.Put(entry->IID(), entry);
     mWorkingSet.mNameTable.Put(entry->GetTheName(), entry);
 
     typelib->SetEntryAt(idx, entry);
 }
 
 // this is a private helper
--- a/xpcom/reflect/xptinfo/xptiTypelibGuts.cpp
+++ b/xpcom/reflect/xptinfo/xptiTypelibGuts.cpp
@@ -46,30 +46,30 @@ xptiTypelibGuts::GetEntryAt(uint16_t i)
 
     const XPTInterfaceDirectoryEntry* iface = mHeader->mInterfaceDirectory + i;
 
     XPTInterfaceInfoManager::xptiWorkingSet& set =
         XPTInterfaceInfoManager::GetSingleton()->mWorkingSet;
 
     {
         ReentrantMonitorAutoEnter monitor(set.mTableReentrantMonitor);
-        if (iface->iid.Equals(zeroIID))
-            r = set.mNameTable.Get(iface->name);
+        if (iface->mIID.Equals(zeroIID))
+            r = set.mNameTable.Get(iface->mName);
         else
-            r = set.mIIDTable.Get(iface->iid);
+            r = set.mIIDTable.Get(iface->mIID);
     }
 
     if (r)
         SetEntryAt(i, r);
 
     return r;
 }
 
 const char*
 xptiTypelibGuts::GetEntryNameAt(uint16_t i)
 {
     NS_ASSERTION(mHeader, "bad state");
     NS_ASSERTION(i < GetEntryCount(), "bad index");
 
     const XPTInterfaceDirectoryEntry* iface = mHeader->mInterfaceDirectory + i;
 
-    return iface->name;
+    return iface->mName;
 }
--- a/xpcom/typelib/xpt/xpt_struct.cpp
+++ b/xpcom/typelib/xpt/xpt_struct.cpp
@@ -184,28 +184,28 @@ XPT_DoHeader(XPTArena *arena, NotNull<XP
 /* InterfaceDirectoryEntry records go in the header */
 bool
 DoInterfaceDirectoryEntry(XPTArena *arena, NotNull<XPTCursor*> cursor,
                           XPTInterfaceDirectoryEntry *ide)
 {
     const char* dummy_name_space;
 
     /* write the IID in our cursor space */
-    if (!XPT_DoIID(cursor, &(ide->iid)) ||
+    if (!XPT_DoIID(cursor, &(ide->mIID)) ||
 
         /* write the name string in the data pool, and the offset in our
            cursor space */
-        !XPT_DoCString(arena, cursor, &(ide->name)) ||
+        !XPT_DoCString(arena, cursor, &(ide->mName)) ||
 
         /* don't write the name_space string in the data pool, because we don't
          * need it. Do write the offset in our cursor space */
         !XPT_DoCString(arena, cursor, &dummy_name_space, /* ignore = */ true) ||
 
         /* do InterfaceDescriptors */
-        !DoInterfaceDescriptor(arena, cursor, &ide->interface_descriptor)) {
+        !DoInterfaceDescriptor(arena, cursor, &ide->mInterfaceDescriptor)) {
         return false;
     }
 
     return true;
 }
 
 static bool
 InterfaceDescriptorAddType(XPTArena *arena,
--- a/xpcom/typelib/xpt/xpt_struct.h
+++ b/xpcom/typelib/xpt/xpt_struct.h
@@ -66,24 +66,24 @@ struct XPTHeader {
 
 /*
  * A contiguous array of fixed-size InterfaceDirectoryEntry records begins at
  * the byte offset identified by the mInterfaceDirectory field in the file
  * header.  The array is used to quickly locate an interface description
  * using its IID.  No interface should appear more than once in the array.
  */
 struct XPTInterfaceDirectoryEntry {
-  nsID iid;
-  const char* name;
+  nsID mIID;
+  const char* mName;
 
   // This field exists in the on-disk format. But it isn't used so we don't
   // allocate space for it in memory.
-  //const char* name_space;
+  //const char* mNameSpace;
 
-  const XPTInterfaceDescriptor* interface_descriptor;
+  const XPTInterfaceDescriptor* mInterfaceDescriptor;
 };
 
 /*
  * An InterfaceDescriptor describes a single XPCOM interface, including all of
  * its methods.
  */
 struct XPTInterfaceDescriptor {
   static const uint8_t kScriptableMask =                0x80;