Closed Bug 445624 Opened 16 years ago Closed 16 years ago

Delete dead code on JSObject2NativeInterface hot path

Categories

(Core :: XPConnect, defect)

Other Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jorendorff, Assigned: jorendorff)

Details

Attachments

(1 file)

js/src/xpconnect/src/xpcconvert.cpp, XPCConvert::JSObject2NativeInterface:

  1302	        // Is this really a native xpcom object with a wrapper?
  1303	        XPCWrappedNative* wrappedNative =
  1304	                    XPCWrappedNative::GetWrappedNativeOfJSObject(cx, src);
  1305	        if(wrappedNative)
  1306	        {
  1307	            iface = wrappedNative->GetIdentityObject();
  1308	            // is the underlying object the right interface?
* 1309	            if(wrappedNative->GetIID().Equals(*iid))
  1310	            {
  1311	                NS_ADDREF(iface);
  1312	                *dest = iface;
  1313	                return JS_TRUE;
  1314	            }
  1315	            return NS_SUCCEEDED(iface->QueryInterface(*iid, dest));
  1316	        }

The call to GetIID() at line 1309 is actually getting the IID of nsIXPConnectWrappedNative, which isn't even scriptable.  So that if-block is inoperable and should be deleted.
Attached patch v1Splinter Review
Assignee: nobody → jorendorff
Status: NEW → ASSIGNED
Attachment #329946 - Flags: review?(jst)
Attachment #329946 - Flags: superreview+
Attachment #329946 - Flags: review?(jst)
Attachment #329946 - Flags: review+
Pushed http://hg.mozilla.org/mozilla-central/index.cgi/rev/9062f559c59a
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: