Bug 76946

Summary: Make DataTransferItemList::length() const.
Product: WebKit Reporter: Daniel Cheng <dcheng>
Component: New BugsAssignee: Daniel Cheng <dcheng>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch tony: review+

Description Daniel Cheng 2012-01-24 14:26:57 PST
Make DataTransferItemList::length() const.
Comment 1 Daniel Cheng 2012-01-24 14:27:23 PST
Created attachment 123810 [details]
Patch
Comment 2 Tony Chang 2012-01-24 14:46:40 PST
Comment on attachment 123810 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=123810&action=review

> Source/WebCore/ChangeLog:8
> +
> +        No new tests. (OOPS!)

Please include a sentence saying why length should be const.  No new tests seems fine, but you'll have to remove the OOPS.

> Source/WebCore/platform/chromium/DataTransferItemListChromium.cpp:67
> +    // FIXME: This is a pretty evil.
> +    const Vector<RefPtr<DataTransferItem> >& items = m_items;
> +    clipboardChromium()->mayUpdateItems(const_cast<Vector<RefPtr<DataTransferItem> >&>(items));

I would make m_items mutable with a FIXME saying that it will be fixed in https://bugs.webkit.org/show_bug.cgi?id=76598 .
Comment 3 Daniel Cheng 2012-01-24 15:39:52 PST
Created attachment 123827 [details]
Patch
Comment 4 Tony Chang 2012-01-24 15:45:16 PST
Comment on attachment 123827 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=123827&action=review

> Source/WebCore/platform/chromium/DataTransferItemListChromium.h:69
> +    // FIXME: This will be fixed by https://bugs.webkit.org/show_bug.cgi?id=76598
> +    mutable Vector<RefPtr<DataTransferItem> > m_items;

Nit: I would be explicit about what "This" refers to.  E.g., "FIXME: m_items should not be mutable.  This will be fixed by https://bugs.webkit.org/show_bug.cgi?id=76598."
Comment 5 Daniel Cheng 2012-01-24 15:47:04 PST
Committed r105825: <http://trac.webkit.org/changeset/105825>