Bug 158207

Summary: Move CrossThreadCopier/CrossThreadTask to WTF
Product: WebKit Reporter: Brady Eidson <beidson>
Component: Web Template FrameworkAssignee: Brady Eidson <beidson>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, commit-queue
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 158208, 158215    
Attachments:
Description Flags
Patch
none
Patch none

Description Brady Eidson 2016-05-30 09:11:14 PDT
Move CrossThreadCopier/CrossThreadTask to WTF
Comment 1 Brady Eidson 2016-05-30 14:19:04 PDT
Created attachment 280112 [details]
Patch
Comment 2 WebKit Commit Bot 2016-05-30 14:21:54 PDT
Attachment 280112 [details] did not pass style-queue:


ERROR: Source/WTF/wtf/CrossThreadCopier.cpp:44:  When wrapping a line, only indent 4 spaces.  [whitespace/indent] [3]
ERROR: Source/WTF/wtf/CrossThreadCopier.cpp:49:  When wrapping a line, only indent 4 spaces.  [whitespace/indent] [3]
ERROR: Source/WTF/wtf/CrossThreadCopier.cpp:54:  When wrapping a line, only indent 4 spaces.  [whitespace/indent] [3]
ERROR: Source/WTF/wtf/CrossThreadTask.h:36:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WTF/wtf/CrossThreadTask.h:50:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 5 in 25 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Brady Eidson 2016-05-30 14:47:41 PDT
Created attachment 280113 [details]
Patch
Comment 4 WebKit Commit Bot 2016-05-30 14:49:05 PDT
Attachment 280113 [details] did not pass style-queue:


ERROR: Source/WTF/wtf/CrossThreadCopier.cpp:44:  When wrapping a line, only indent 4 spaces.  [whitespace/indent] [3]
ERROR: Source/WTF/wtf/CrossThreadCopier.cpp:49:  When wrapping a line, only indent 4 spaces.  [whitespace/indent] [3]
ERROR: Source/WTF/wtf/CrossThreadCopier.cpp:54:  When wrapping a line, only indent 4 spaces.  [whitespace/indent] [3]
ERROR: Source/WTF/wtf/CrossThreadTask.h:36:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WTF/wtf/CrossThreadTask.h:50:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 5 in 25 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Alex Christensen 2016-05-30 16:22:37 PDT
Comment on attachment 280113 [details]
Patch

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

> Source/WebCore/platform/WebCoreCrossThreadCopier.cpp:2
> + * Copyright (C) 2009 Google Inc. All rights reserved.

Google? Isn't this a new file?

> Source/WebCore/platform/WebCoreCrossThreadCopier.h:44
> +    typedef WebCore::SessionID Type;

Darin has been using using for typedefs recently
Comment 6 Brady Eidson 2016-05-30 20:12:13 PDT
(In reply to comment #5)
> Comment on attachment 280113 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=280113&action=review
> 
> > Source/WebCore/platform/WebCoreCrossThreadCopier.cpp:2
> > + * Copyright (C) 2009 Google Inc. All rights reserved.
> 
> Google? Isn't this a new file?

Ahhhhhhhh git. Not always getting file version history.

(No, it's not)

> > Source/WebCore/platform/WebCoreCrossThreadCopier.h:44
> > +    typedef WebCore::SessionID Type;
> 
> Darin has been using using for typedefs recently

I'll decline to change that at this point as the typedef is established in the copiers.

Interesting that we're starting to do that. I'm not sure I see the advantage.
Comment 7 WebKit Commit Bot 2016-05-30 20:34:30 PDT
Comment on attachment 280113 [details]
Patch

Clearing flags on attachment: 280113

Committed r201504: <http://trac.webkit.org/changeset/201504>
Comment 8 WebKit Commit Bot 2016-05-30 20:34:34 PDT
All reviewed patches have been landed.  Closing bug.
Comment 9 Chris Dumez 2016-05-30 21:01:41 PDT
(In reply to comment #6)
> (In reply to comment #5)
> > Comment on attachment 280113 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=280113&action=review
> > 
> > > Source/WebCore/platform/WebCoreCrossThreadCopier.cpp:2
> > > + * Copyright (C) 2009 Google Inc. All rights reserved.
> > 
> > Google? Isn't this a new file?
> 
> Ahhhhhhhh git. Not always getting file version history.
> 
> (No, it's not)
> 
> > > Source/WebCore/platform/WebCoreCrossThreadCopier.h:44
> > > +    typedef WebCore::SessionID Type;
> > 
> > Darin has been using using for typedefs recently
> 
> I'll decline to change that at this point as the typedef is established in
> the copiers.
> 
> Interesting that we're starting to do that. I'm not sure I see the advantage.

Not a big deal, but I prefer "using" as well because I find it more readable than a typedef (I am always confused about which comes first in a typedef statement, the alias or the type). Also, using can be templated, unlike typedef.
Comment 10 Brady Eidson 2016-05-30 21:41:10 PDT
(In reply to comment #9)
> (In reply to comment #6)
> > (In reply to comment #5)
> > > Comment on attachment 280113 [details]
> > > Patch
> > > 
> > > View in context:
> > > https://bugs.webkit.org/attachment.cgi?id=280113&action=review
> > > 
> > > > Source/WebCore/platform/WebCoreCrossThreadCopier.cpp:2
> > > > + * Copyright (C) 2009 Google Inc. All rights reserved.
> > > 
> > > Google? Isn't this a new file?
> > 
> > Ahhhhhhhh git. Not always getting file version history.
> > 
> > (No, it's not)
> > 
> > > > Source/WebCore/platform/WebCoreCrossThreadCopier.h:44
> > > > +    typedef WebCore::SessionID Type;
> > > 
> > > Darin has been using using for typedefs recently
> > 
> > I'll decline to change that at this point as the typedef is established in
> > the copiers.
> > 
> > Interesting that we're starting to do that. I'm not sure I see the advantage.
> 
> Not a big deal, but I prefer "using" as well because I find it more readable
> than a typedef (I am always confused about which comes first in a typedef
> statement, the alias or the type).

This is certainly subjective. I'm the opposite. typedef has exactly one use, and has for the entire existence of C++, and the order has never changed. I also think the context almost always makes it clear which is the newly declared type.

Whereas with using I always have to get over a mental hurdle of "why am I seeing this here, and why with an '='? Statements that use 'using' have never had '='..."

> Also, using can be templated, unlike typedef.

This is definitely an objective advantage.

One I've never seen in practice, though. :)