Bug 76946 - Make DataTransferItemList::length() const.
Summary: Make DataTransferItemList::length() const.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Daniel Cheng
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-24 14:26 PST by Daniel Cheng
Modified: 2012-01-24 15:47 PST (History)
0 users

See Also:


Attachments
Patch (4.88 KB, patch)
2012-01-24 14:27 PST, Daniel Cheng
no flags Details | Formatted Diff | Diff
Patch (5.01 KB, patch)
2012-01-24 15:39 PST, Daniel Cheng
tony: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>