Bug 173832

Summary: Refactor drag start codepaths to plumb a DragItem to client layers
Product: WebKit Reporter: Wenson Hsieh <wenson_hsieh>
Component: WebCore Misc.Assignee: Wenson Hsieh <wenson_hsieh>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, buildbot, cdumez, dbates, japhet, megan_gardner, rniwa, thorton
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
First pass
none
Attempt to fix Windows build
rniwa: review+
Patch for landing none

Description Wenson Hsieh 2017-06-26 07:52:29 PDT
Work towards <rdar://problem/32236827>
Comment 1 Wenson Hsieh 2017-06-26 08:32:09 PDT
Created attachment 313841 [details]
First pass
Comment 2 Wenson Hsieh 2017-06-26 11:56:34 PDT
Created attachment 313858 [details]
Attempt to fix Windows build
Comment 3 Ryosuke Niwa 2017-06-27 00:08:26 PDT
Comment on attachment 313858 [details]
Attempt to fix Windows build

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

It's a bit scary to expose DragItem like this to WebKit/WebKit2 but I guess there isn't a good alternative here.
r=me.

> Source/WebKit2/Shared/WebCoreArgumentCoders.h:541
> +#if ENABLE(DRAG_SUPPORT)
> +template<> struct ArgumentCoder<WebCore::DragItem> {

Modern coding style is to implement encode/decode in WebCore right next to the actual data type.
Comment 4 Ryosuke Niwa 2017-06-27 00:19:10 PDT
Comment on attachment 313858 [details]
Attempt to fix Windows build

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

> Source/WebKit2/Shared/WebCoreArgumentCoders.cpp:2235
> +    encoder << hasIndicatorData;
> +    if (hasIndicatorData)
> +        encoder << item.image.indicatorData().value();

It's a bit strange to not include the image data but only the indicator data.
We should probably add a FIXME here.
Comment 5 Wenson Hsieh 2017-06-27 10:26:33 PDT
Created attachment 313925 [details]
Patch for landing
Comment 6 Wenson Hsieh 2017-06-27 10:28:25 PDT
Comment on attachment 313858 [details]
Attempt to fix Windows build

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

>> Source/WebKit2/Shared/WebCoreArgumentCoders.cpp:2235
>> +        encoder << item.image.indicatorData().value();
> 
> It's a bit strange to not include the image data but only the indicator data.
> We should probably add a FIXME here.

I added a FIXME earlier in this function that references wkbug.com/173815, which tracks the rest of the DragItems refactoring.

>> Source/WebKit2/Shared/WebCoreArgumentCoders.h:541
>> +template<> struct ArgumentCoder<WebCore::DragItem> {
> 
> Modern coding style is to implement encode/decode in WebCore right next to the actual data type.

Got it -- fixed!
Comment 7 Wenson Hsieh 2017-06-27 12:11:55 PDT
Comment on attachment 313925 [details]
Patch for landing

Committed r218837: <http://trac.webkit.org/changeset/218837>