[tbb-dev] Problems getting a nsIChannel reference

Arthur D. Edelstein arthuredelstein at gmail.com
Thu Jan 15 16:16:25 UTC 2015


Hi Michael,

>>Could you add a flag to DataStruct::SetData, like
>>`DataStruct::SetData (nsISupports* aData, uint32_t aDataLen, bool private)`
>>
> Yes, per my suggestion 'changing the API' at the meeting.
> This breaks binary compatability, but it might not be as
> bad as I thought, since the interface isn't exposed in IDL.

What binary compatibility are you concerned about?

> By the way:
>
> tor-browser$ find . -name '*.cpp' -exec grep 'SetData' {} \; -print | wc
>   883 (!)   2174   49443

It looks to me like the DataStruct::SetData function is only called by
nsTransferable::GetTransferData and
nsTransferable::GetAnyTransferData. You can click on "GetData" here
and choose "Find callers":
https://dxr.mozilla.org/mozilla-central/source/widget/nsTransferable.cpp#75

>>The nsTransferable::mPrivateData field seems to indicate
>>if the data came from a private browsing load context:
>>https://dxr.mozilla.org/mozilla-central/source/widget/nsTransferable.cpp#234
>>
> mPrivateData is a protected member of another class, so dead end.

But nsTransferable is calling DataStruct::SetData, so, if you add the
extra argument to SetData, you can pass the value of mPrivateData,
even though it is a protected member of nsTransferable.

Best regards,
Arthur


More information about the tbb-dev mailing list