Bug 1275719 - GetShimForParam should traverse parent objects. r=froydnj
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Thu, 26 May 2016 23:09:06 +0900
changeset 338467 8d6528df69a06d28adc9526e11108cbe4f35ac52
parent 338466 0d7674be600defa53a0721874b75731d56c09fc7
child 338468 0f2f4ea1472c3ec67476ba55cba2ce1868284657
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1275719
milestone49.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 1275719 - GetShimForParam should traverse parent objects. r=froydnj When using GetIIDForParamNoAlloc to get return paramter type, if param is nsIDOM*, it should get it by GetShimForParam. When this situation, GetEntryFor Param tries to get nsIDOMDocument, so GetEntryForParam doesn't get entry. Then, GetShimForParam tries to get entry. But since it doesn't traverse parent objects, it will try to get nsIDocShell instead. So it might not get correct entry. MozReview-Commit-ID: LaOVymgFMgi
xpcom/reflect/xptinfo/xptiInterfaceInfo.cpp
--- a/xpcom/reflect/xptinfo/xptiInterfaceInfo.cpp
+++ b/xpcom/reflect/xptinfo/xptiInterfaceInfo.cpp
@@ -386,16 +386,20 @@ xptiInterfaceEntry::GetEntryForParam(uin
     *entry = theEntry;
     return NS_OK;
 }
 
 already_AddRefed<ShimInterfaceInfo>
 xptiInterfaceEntry::GetShimForParam(uint16_t methodIndex,
                                     const nsXPTParamInfo* param)
 {
+    if(methodIndex < mMethodBaseIndex) {
+        return mParent->GetShimForParam(methodIndex, param);
+    }
+
     uint16_t interfaceIndex = 0;
     nsresult rv = GetInterfaceIndexForParam(methodIndex, param,
                                             &interfaceIndex);
     if (NS_FAILED(rv)) {
         return nullptr;
     }
 
     const char* shimName = mTypelib->GetEntryNameAt(interfaceIndex - 1);