Bug 157185 - Add a default ".isolatedCopy()" specialization to CrossThreadCopier, and other small cleanup
Summary: Add a default ".isolatedCopy()" specialization to CrossThreadCopier, and othe...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brady Eidson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-29 09:36 PDT by Brady Eidson
Modified: 2016-04-29 10:05 PDT (History)
0 users

See Also:


Attachments
Patch v1 (16.60 KB, patch)
2016-04-29 09:39 PDT, Brady Eidson
andersca: review+
Details | Formatted Diff | Diff

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