Bug 157185

Summary: Add a default ".isolatedCopy()" specialization to CrossThreadCopier, and other small cleanup
Product: WebKit Reporter: Brady Eidson <beidson>
Component: WebCore Misc.Assignee: Brady Eidson <beidson>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch v1 andersca: review+

Description Brady Eidson 2016-04-29 09:36:35 PDT
Add a default ".isolatedCopy()" specialization to CrossThreadCopier

This greatly simplifies the CrossThreadCopier code with what has become a de-facto best practice, and removes lots of code in the process
Comment 1 Brady Eidson 2016-04-29 09:39:36 PDT
Created attachment 277708 [details]
Patch v1
Comment 2 Anders Carlsson 2016-04-29 09:57:40 PDT
Comment on attachment 277708 [details]
Patch v1

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

> Source/WebCore/platform/CrossThreadCopier.cpp:139
> +COMPILE_ASSERT((std::is_same<int, CrossThreadCopier<PassRefPtr<CopierRefCountedTest>>::Type>::value), PassRefPtrRefCountedTest);
> +COMPILE_ASSERT((std::is_same<int, CrossThreadCopier<RefPtr<CopierRefCountedTest>>::Type>::value), RefPtrRefCountedTest);
> +COMPILE_ASSERT((std::is_same<int, CrossThreadCopier<CopierRefCountedTest*>::Type>::value), RawPointerRefCountedTest);

Please change these to static_asserts while you're at it.

> Source/WebCore/platform/CrossThreadCopier.h:105
> +    WEBCORE_EXPORT static T copy(const T& value)

Does this really need to be WEBCORE_EXPORT?
Comment 3 Brady Eidson 2016-04-29 09:58:56 PDT
(In reply to comment #2)
> Comment on attachment 277708 [details]
> Patch v1
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=277708&action=review
> 
> > Source/WebCore/platform/CrossThreadCopier.h:105
> > +    WEBCORE_EXPORT static T copy(const T& value)
> 
> Does this really need to be WEBCORE_EXPORT?

I'll double check.
Comment 4 Brady Eidson 2016-04-29 09:59:28 PDT
(In reply to comment #3)
> (In reply to comment #2)
> > Comment on attachment 277708 [details]
> > Patch v1
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=277708&action=review
> > 
> > > Source/WebCore/platform/CrossThreadCopier.h:105
> > > +    WEBCORE_EXPORT static T copy(const T& value)
> > 
> > Does this really need to be WEBCORE_EXPORT?
> 
> I'll double check.

(Since it's templates in a header, probably not)
Comment 5 Brady Eidson 2016-04-29 10:05:28 PDT
http://trac.webkit.org/changeset/200249