Bug 46004 - Change Clipboard to use an enum instead of isForDragging = true/false
Summary: Change Clipboard to use an enum instead of isForDragging = true/false
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-17 15:26 PDT by Daniel Cheng
Modified: 2010-09-21 13:52 PDT (History)
10 users (show)

See Also:


Attachments
Patch (44.02 KB, patch)
2010-09-17 15:28 PDT, Daniel Cheng
no flags Details | Formatted Diff | Diff
Patch (49.02 KB, patch)
2010-09-20 11:32 PDT, Daniel Cheng
levin: commit-queue-
Details | Formatted Diff | Diff
Patch (49.43 KB, patch)
2010-09-20 23:42 PDT, Daniel Cheng
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Cheng 2010-09-17 15:26:35 PDT
The bool parameter can get hard to follow, and leads to mistakes--I fixed one probable error while updating the various platforms to use the enum instead of the bool.
Comment 1 Daniel Cheng 2010-09-17 15:28:58 PDT
Created attachment 67962 [details]
Patch

Flagging for R? so the EWS bots can try out the patch first.
Comment 2 Tony Chang 2010-09-17 15:35:54 PDT
This is great.  I will r+ cq+ as soon as the ews bots go green (I think r+'ing cancels the ews run).
Comment 3 Daniel Bates 2010-09-17 15:43:24 PDT
I prefer enums over booleans. Is it proper to call these drag-drop and copy-paste instead of drag-and-drop and copy-and-paste? Hence, name the enum value DragAndDrop and CopyAndPaste.
Comment 4 Daniel Cheng 2010-09-17 16:47:57 PDT
(In reply to comment #3)
> I prefer enums over booleans. Is it proper to call these drag-drop and copy-paste instead of drag-and-drop and copy-and-paste? Hence, name the enum value DragAndDrop and CopyAndPaste.

I like this idea. I'll update the patch once I get back EWS results.
Comment 5 WebKit Review Bot 2010-09-17 16:50:14 PDT
Attachment 67962 [details] did not build on gtk:
Build output: http://queues.webkit.org/results/4071054
Comment 6 Early Warning System Bot 2010-09-18 16:11:29 PDT
Attachment 67962 [details] did not build on qt:
Build output: http://queues.webkit.org/results/4066060
Comment 7 WebKit Review Bot 2010-09-18 21:46:47 PDT
Attachment 67962 [details] did not build on win:
Build output: http://queues.webkit.org/results/4034072
Comment 8 Daniel Cheng 2010-09-20 11:32:19 PDT
Created attachment 68114 [details]
Patch

Fix the compile errors and rename CopyPaste/DragDrop to CopyAndPaste/DragAndDrop.
Comment 9 David Levin 2010-09-20 14:44:22 PDT
Comment on attachment 68114 [details]
Patch

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

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

This needs to be replaced with an explanation. Either:
1. Name the test(s),
2. Describe why a test isn't possible, or
3. Indicate that no new functionality is exposed so no new test is needed.

> WebCore/dom/Clipboard.h:96
> +        Clipboard(ClipboardAccessPolicy, ClipboardType clipboardType);

Parameter name "clipboardType" shouldn't be here.

> WebCore/platform/chromium/ClipboardChromium.cpp:207
>              // If this isn't for a drag, it's for a cut/paste event handler.

It looks like this comment isn't needed anymore (but if you remove it, you need to update the next comment line slightly).

> WebCore/platform/chromium/ClipboardChromium.cpp:223
>              // If this isn't for a drag, it's for a cut/paste event handler.

Ditto.

> WebCore/platform/mac/ClipboardMac.h:82
> +    ClipboardMac(ClipboardType clipboardType, NSPasteboard *, ClipboardAccessPolicy, Frame*);

Param name should go away.

> WebCore/platform/win/ClipboardWin.h:81
> +    ClipboardWin(ClipboardType clipboardType, IDataObject*, ClipboardAccessPolicy, Frame*);
> +    ClipboardWin(ClipboardType clipboardType, WCDataObject*, ClipboardAccessPolicy, Frame*);

Param name should go away.

> WebCore/platform/wx/ClipboardWx.h:68
> +        ClipboardWx(ClipboardAccessPolicy, ClipboardType clipboardType);

Param name should go away.
Comment 10 David Levin 2010-09-20 14:47:27 PDT
(In reply to comment #9)
> (From update of attachment 68114 [details])

Basically consider this an r- (but I want to make sure the ews runs finish.)
Comment 11 Daniel Cheng 2010-09-20 23:42:02 PDT
Created attachment 68194 [details]
Patch

(In reply to comment #9)
> (From update of attachment 68114 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=68114&action=review
> 
> > WebCore/ChangeLog:8
> > +        No new tests. (OOPS!)
> 
> This needs to be replaced with an explanation. Either:
> 1. Name the test(s),
> 2. Describe why a test isn't possible, or
> 3. Indicate that no new functionality is exposed so no new test is needed.
> 

Done.

> > WebCore/dom/Clipboard.h:96
> > +        Clipboard(ClipboardAccessPolicy, ClipboardType clipboardType);
> 
> Parameter name "clipboardType" shouldn't be here.
> 

Done.

> > WebCore/platform/chromium/ClipboardChromium.cpp:207
> >              // If this isn't for a drag, it's for a cut/paste event handler.
> 
> It looks like this comment isn't needed anymore (but if you remove it, you need to update the next comment line slightly).
> 
> > WebCore/platform/chromium/ClipboardChromium.cpp:223
> >              // If this isn't for a drag, it's for a cut/paste event handler.
> 
> Ditto.

Done.

> 
> > WebCore/platform/mac/ClipboardMac.h:82
> > +    ClipboardMac(ClipboardType clipboardType, NSPasteboard *, ClipboardAccessPolicy, Frame*);
> 
> Param name should go away.
> 

Done.

> > WebCore/platform/win/ClipboardWin.h:81
> > +    ClipboardWin(ClipboardType clipboardType, IDataObject*, ClipboardAccessPolicy, Frame*);
> > +    ClipboardWin(ClipboardType clipboardType, WCDataObject*, ClipboardAccessPolicy, Frame*);
> 
> Param name should go away.
> 

Done.

> > WebCore/platform/wx/ClipboardWx.h:68
> > +        ClipboardWx(ClipboardAccessPolicy, ClipboardType clipboardType);
> 
> Param name should go away.

Done.
Comment 12 WebKit Commit Bot 2010-09-21 11:50:32 PDT
Comment on attachment 68194 [details]
Patch

Clearing flags on attachment: 68194

Committed r67973: <http://trac.webkit.org/changeset/67973>
Comment 13 WebKit Commit Bot 2010-09-21 11:50:38 PDT
All reviewed patches have been landed.  Closing bug.