Closed Bug 983990 Opened 10 years ago Closed 10 years ago

Convert nsPluginStreamListenerPeer::mDataForwardToRequest to nsDataHashtable<nsUint32HashKey, uint32_t>

Categories

(Core Graveyard :: Plug-ins, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla31

People

(Reporter: mccr8, Assigned: anujagarwal464)

References

Details

Attachments

(2 files, 1 obsolete file)

The table currently uses 32-bit keys, but it looks like the comments like "XXX support 64-bit offsets" can be addressed by using 64-bit keys and dropping the conversions.
Thanks, let me know if you have any questions!
Assignee: nobody → anujagarwal464
Comment on attachment 8391893 [details] [diff] [review]
bug983990.diff

Review of attachment 8391893 [details] [diff] [review]:
-----------------------------------------------------------------

Looking over the code some more now, I think I gave bad advice about switching things to 64-bit.  Sorry about that.  I think that for now it makes sense to  convert the hash table to nsDataHashtable<nsUint32HashKey, uint32_t>, using absoluteOffset instead of absoluteOffset64.  Converting this code properly over to 64-bit will require some wider-ranging code changes, so it makes sense to do that in a separate bug (if that is something that is even still desired).  Of course, changing the hash table should make that easier to do.  When you update your patch for that, I can take a look at it.

::: dom/plugins/base/nsPluginStreamListenerPeer.cpp
@@ +823,2 @@
>        int32_t amtForwardToPlugin =
> +      NS_PTR_TO_INT32(mDataForwardToRequest->Get(absoluteOffset64));

You should be able to get rid of NS_PTR_TO_INT32.  I think this was needed because nsHashtable was storing void* as its data, but with nsDataHashtable you'll get the actual int32_t out of it that you need.
Attachment #8391893 - Flags: feedback?(continuation)
Other than those comments, your patch looks good.
Attachment #8391893 - Attachment is obsolete: true
Attachment #8391920 - Flags: review?(continuation)
Summary: Convert nsPluginStreamListenerPeer::mDataForwardToRequest to nsDataHashtable<nsUint64HashKey, uint32_t> → Convert nsPluginStreamListenerPeer::mDataForwardToRequest to nsDataHashtable<nsUint32HashKey, uint32_t>
Comment on attachment 8391920 [details] [diff] [review]
nsDataHashtable<nsUint32HashKey, uint32_t>

Review of attachment 8391920 [details] [diff] [review]:
-----------------------------------------------------------------

This looks good to me, thanks. I'll forward this to John for a review.
Attachment #8391920 - Flags: review?(jschoenick)
Attachment #8391920 - Flags: review?(continuation)
Attachment #8391920 - Flags: feedback+
(In reply to Andrew McCreight [:mccr8] from comment #3)

> You should be able to get rid of NS_PTR_TO_INT32.  I think this was needed
> because nsHashtable was storing void* as its data, but with nsDataHashtable
> you'll get the actual int32_t out of it that you need.

I will get uint32_t from nsDataHashtable. I think i should type cast it to int32_t before assigning.
Comment on attachment 8391920 [details] [diff] [review]
nsDataHashtable<nsUint32HashKey, uint32_t>

Review of attachment 8391920 [details] [diff] [review]:
-----------------------------------------------------------------

lgtm

::: dom/plugins/base/nsPluginStreamListenerPeer.cpp
@@ +889,5 @@
>      int64_t absoluteOffset64 = 0;
>      brr->GetStartRange(&absoluteOffset64);
>      // XXX support 64-bit offsets
>      int32_t absoluteOffset = (int32_t)int64_t(absoluteOffset64);
> +        

Whitespace! Not that this file isn't covered in it.
Attachment #8391920 - Flags: review?(jschoenick) → review+
I can fix the whitespace when I land it.
Comment on attachment 8392407 [details] [diff] [review]
Remove all trailing whitespace from nsPluginStreamListenerPeer.

rs=bsmedberg over IRC
Attachment #8392407 - Flags: review?(jschoenick) → review+
https://hg.mozilla.org/mozilla-central/rev/56dc258068bc
https://hg.mozilla.org/mozilla-central/rev/8fdfcc4878db
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: