[tor-bugs] #8167 [TorBrowserButton]: Replace deprecated getOriginatingURI() method in Torbutton

Tor Bug Tracker & Wiki blackhole at torproject.org
Wed Dec 4 20:54:02 UTC 2013


#8167: Replace deprecated getOriginatingURI() method in Torbutton
-------------------------+-------------------------------------------------
     Reporter:  gk       |      Owner:  mikeperry
         Type:  defect   |     Status:  needs_revision
     Priority:  normal   |  Milestone:
    Component:           |    Version:
  TorBrowserButton       |   Keywords:  tbb-linkability, ff24-esr,
   Resolution:           |  MikePerry201312R
Actual Points:           |  Parent ID:
       Points:           |
-------------------------+-------------------------------------------------

Comment (by mcs):

 Replying to [comment:8 mikeperry]:
 > For the record: It turns out that using getFirstPartyURI fails with a
 weird exception here (NS_ERROR_XPC_CANT_GET_PARAM_IFACE_INFO). I decided
 to update this bug with a modified version of the patch anyway in case
 either mcs or brade have any ideas why this API would fail here. As far as
 I can tell, it's throwing that exception before the C++ is even invoked
 :/.

 It turns out that the problem is that nsIDocument is not IDL'd, so we
 cannot use it from JS.  Even though we just want to pass null for the
 second parameter to getFirstPartyURI(), things blow up when the browser
 tries to get type info for that parameter.  Kathy says that the reason
 nsIDocument is not IDL'd is to improve performance.

 We have a couple of options:

 Option 1:  In the IDL, put [noscript] in front of the existing
 getFirstPartyURI() method and add a second method that just takes a
 channel, e.g.,

  [noscript] nsIURI getFirstPartyURI(in nsIChannel aChannel, in nsIDocument
 aDoc);
  ...
  nsIURI getFirstPartyURIFromChannel(in nsIChannel aChannel)

 Existing C++ code would not need to be changed, and we would call the new
 method from the SafeCache code inside Torbutton.  This is probably the
 easiest solution.

 Option 2:  Change the type of the aDoc parameter to nsISupports and QI it
 inside the C++ implementation, e.g.,

  nsIURI getFirstPartyURI(in nsIChannel aChannel, in nsISupports
 aDocSupports);

 This probably would force us to change all of our existing C++ calls to
 getFirstPartyURI() and we would lose some type safety in the API.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/8167#comment:9>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list