WebKit Bugzilla
Attachment 347462 Details for
Bug 188733
: [Cocoa] Consolidate inline "wrapper" functions in WebKit API into function templates and WrapperTraits
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188733-20180819124210.patch (text/plain), 62.55 KB, created by
Darin Adler
on 2018-08-19 12:42:11 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Darin Adler
Created:
2018-08-19 12:42:11 PDT
Size:
62.55 KB
patch
obsolete
>Subversion Revision: 235016 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index b80e102e9e1d0b71e0fd5effd3a2da1c8f8b78a8..e3541593c48bbfcdcfbcdb87796f3c49092fd441 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,82 @@ >+2018-08-19 Darin Adler <darin@apple.com> >+ >+ [Cocoa] Consolidate inline "wrapper" functions in WebKit API into function templates and WrapperTraits >+ https://bugs.webkit.org/show_bug.cgi?id=188733 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Replaced all the different functions named "wrapper" that were all boilerplate doing Objective-C >+ casts with WrapperTraits specializations. The only thing about this that was at all tricky was >+ the loose mixing of the WebKit namespace, the API namespace, and the global namespace. My choice >+ for this first step was to put WrapperTraits into the WebKit namespace and to put the wrapper >+ function into both the WebKit and API namespaces with "using". This turned out pretty clean: did >+ not have to touch any of the code calling wrapper just to make things work, although we can now >+ clean up by changing call sites to get rid of unnecessary explicit use of leakRef and autorelease. >+ Doing this will make ARC conversion practical and easy, which is the motivation behind pursuing >+ this set of changes. >+ >+ * Shared/Cocoa/WKObject.h: Tweaked style of the ObjectStorage structure template, >+ using a class name instead of "T". Added WrapperTraits structure template, checkedObjCCast >+ function template, and multiple wrapper functions templates that take a variety of pointer, >+ reference, smart pointer, and smart reference types, and return the wrapper for each one, >+ handling object lifetime appropriately. >+ >+ * Shared/API/Cocoa/_WKFrameHandleInternal.h: >+ * Shared/API/Cocoa/_WKHitTestResultInternal.h: >+ * Shared/Cocoa/WKNSArray.h: >+ * Shared/Cocoa/WKNSData.h: >+ * Shared/Cocoa/WKNSDictionary.h: >+ * Shared/Cocoa/WKNSError.h: >+ * Shared/Cocoa/WKNSNumber.h: >+ * Shared/Cocoa/WKNSString.h: >+ * Shared/Cocoa/WKNSURL.h: >+ * Shared/Cocoa/WKNSURLRequest.h: >+ * UIProcess/API/Cocoa/WKBackForwardListInternal.h: >+ * UIProcess/API/Cocoa/WKBackForwardListItemInternal.h: >+ * UIProcess/API/Cocoa/WKBrowsingContextGroupInternal.h: >+ * UIProcess/API/Cocoa/WKConnectionInternal.h: >+ * UIProcess/API/Cocoa/WKContentRuleListInternal.h: >+ * UIProcess/API/Cocoa/WKContentRuleListStoreInternal.h: >+ * UIProcess/API/Cocoa/WKFrameInfoInternal.h: >+ * UIProcess/API/Cocoa/WKHTTPCookieStoreInternal.h: >+ * UIProcess/API/Cocoa/WKNSURLAuthenticationChallenge.h: >+ * UIProcess/API/Cocoa/WKNavigationActionInternal.h: >+ * UIProcess/API/Cocoa/WKNavigationDataInternal.h: >+ * UIProcess/API/Cocoa/WKNavigationInternal.h: >+ * UIProcess/API/Cocoa/WKNavigationResponseInternal.h: >+ * UIProcess/API/Cocoa/WKOpenPanelParametersInternal.h: >+ * UIProcess/API/Cocoa/WKPreferencesInternal.h: >+ * UIProcess/API/Cocoa/WKProcessPoolInternal.h: >+ * UIProcess/API/Cocoa/WKSecurityOriginInternal.h: >+ * UIProcess/API/Cocoa/WKUserContentControllerInternal.h: >+ * UIProcess/API/Cocoa/WKUserScriptInternal.h: >+ * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: >+ * UIProcess/API/Cocoa/WKWebsiteDataStoreInternal.h: >+ * UIProcess/API/Cocoa/WKWindowFeaturesInternal.h: >+ * UIProcess/API/Cocoa/_WKApplicationManifestInternal.h: >+ * UIProcess/API/Cocoa/_WKAttachmentInternal.h: >+ * UIProcess/API/Cocoa/_WKAutomationSessionInternal.h: >+ * UIProcess/API/Cocoa/_WKExperimentalFeatureInternal.h: >+ * UIProcess/API/Cocoa/_WKGeolocationPositionInternal.h: >+ * UIProcess/API/Cocoa/_WKProcessPoolConfigurationInternal.h: >+ * UIProcess/API/Cocoa/_WKUserContentWorldInternal.h: >+ * UIProcess/API/Cocoa/_WKUserInitiatedActionInternal.h: >+ * UIProcess/API/Cocoa/_WKUserStyleSheetInternal.h: >+ * UIProcess/API/Cocoa/_WKVisitedLinkStoreInternal.h: >+ * UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h: >+ * UIProcess/Cocoa/DownloadClient.mm: >+ * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrameInternal.h: >+ * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInHitTestResultInternal.h: >+ * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandleInternal.h: >+ * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroupInternal.h: >+ * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandleInternal.h: >+ * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorldInternal.h: >+ * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerInternal.h: >+ * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInInternal.h: >+ Replaced inline wrapper functions with WrapperTraits structure template >+ specializations. This is always in the WebKit namespace, unlike the functions, >+ which were in a mix of namespaces. Also deleted some unneeded "#pragma once". >+ > 2018-08-19 David Kilzer <ddkilzer@apple.com> > > REGRESSION (r234396): Leak of CFURLRef in WebKit::NetworkProcess::deleteHSTSCacheForHostNames() >diff --git a/Source/WebKit/Shared/API/Cocoa/_WKFrameHandleInternal.h b/Source/WebKit/Shared/API/Cocoa/_WKFrameHandleInternal.h >index 498e2bcaee44e9cd6b4f8ea26de1307ff99b50ca..838462569a81cda7fcc8364fa3d664a5e1134384 100644 >--- a/Source/WebKit/Shared/API/Cocoa/_WKFrameHandleInternal.h >+++ b/Source/WebKit/Shared/API/Cocoa/_WKFrameHandleInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2014-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -32,11 +32,9 @@ > > namespace WebKit { > >-inline _WKFrameHandle *wrapper(API::FrameHandle& frameHandle) >-{ >- ASSERT([frameHandle.wrapper() isKindOfClass:[_WKFrameHandle self]]); >- return (_WKFrameHandle *)frameHandle.wrapper(); >-} >+template<> struct WrapperTraits<API::FrameHandle> { >+ using WrapperClass = _WKFrameHandle; >+}; > > } > >diff --git a/Source/WebKit/Shared/API/Cocoa/_WKHitTestResultInternal.h b/Source/WebKit/Shared/API/Cocoa/_WKHitTestResultInternal.h >index 418edebc2a2d63cb9bca721f16ce8cf75d118097..c98fbc88e5a146d500b5bcf96421396dbf8ae236 100644 >--- a/Source/WebKit/Shared/API/Cocoa/_WKHitTestResultInternal.h >+++ b/Source/WebKit/Shared/API/Cocoa/_WKHitTestResultInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2015 Apple Inc. All rights reserved. >+ * Copyright (C) 2015-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -30,14 +30,11 @@ > #import "APIHitTestResult.h" > #import "WKObject.h" > >-namespace API { >+namespace WebKit { > >-inline _WKHitTestResult *wrapper(API::HitTestResult& hitTestResult) >-{ >- ASSERT([hitTestResult.wrapper() isKindOfClass:[_WKHitTestResult class]]); >- >- return (_WKHitTestResult *)hitTestResult.wrapper(); >-} >+template<> struct WrapperTraits<API::HitTestResult> { >+ using WrapperClass = _WKHitTestResult; >+}; > > } > >diff --git a/Source/WebKit/Shared/Cocoa/WKNSArray.h b/Source/WebKit/Shared/Cocoa/WKNSArray.h >index f051fc3f08982b927078185806060747e149488e..374b67c190d55b83514161745b7c215ba9c41fb9 100644 >--- a/Source/WebKit/Shared/Cocoa/WKNSArray.h >+++ b/Source/WebKit/Shared/Cocoa/WKNSArray.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2013 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -30,11 +30,12 @@ > #import "APIArray.h" > #import "WKObject.h" > >-inline NSArray *wrapper(API::Array& array) >-{ >- ASSERT([array.wrapper() isKindOfClass:[NSArray class]]); >+namespace WebKit { >+ >+template<> struct WrapperTraits<API::Array> { >+ using WrapperClass = NSArray; >+}; > >- return (NSArray *)array.wrapper(); > } > > @interface WKNSArray : NSArray <WKObject> >diff --git a/Source/WebKit/Shared/Cocoa/WKNSData.h b/Source/WebKit/Shared/Cocoa/WKNSData.h >index 818d08d4b781c555de7708dc20f0b46af7f49c66..5e4f7d94a5afc5b2040760b89073255c3c21ad95 100644 >--- a/Source/WebKit/Shared/Cocoa/WKNSData.h >+++ b/Source/WebKit/Shared/Cocoa/WKNSData.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2013 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -30,13 +30,11 @@ > #import "APIData.h" > #import "WKObject.h" > >-namespace API { >+namespace WebKit { > >-inline NSData *wrapper(API::Data& data) >-{ >- ASSERT([data.wrapper() isKindOfClass:[NSData self]]); >- return (NSData *)data.wrapper(); >-} >+template<> struct WrapperTraits<API::Data> { >+ using WrapperClass = NSData; >+}; > > } > >diff --git a/Source/WebKit/Shared/Cocoa/WKNSDictionary.h b/Source/WebKit/Shared/Cocoa/WKNSDictionary.h >index 337372c58b9bd8b77be6c6b64845d1d8036b1e2a..047b28bb6003b34b4058654fee7e05124d3e85ef 100644 >--- a/Source/WebKit/Shared/Cocoa/WKNSDictionary.h >+++ b/Source/WebKit/Shared/Cocoa/WKNSDictionary.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2013 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -31,7 +31,11 @@ > #import "WKObject.h" > > namespace WebKit { >-inline NSDictionary *wrapper(API::Dictionary& dictionary) { ASSERT([dictionary.wrapper() isKindOfClass:[NSDictionary class]]); return (NSDictionary *)dictionary.wrapper(); } >+ >+template<> struct WrapperTraits<API::Dictionary> { >+ using WrapperClass = NSDictionary; >+}; >+ > } > > @interface WKNSDictionary : NSDictionary <WKObject> >diff --git a/Source/WebKit/Shared/Cocoa/WKNSError.h b/Source/WebKit/Shared/Cocoa/WKNSError.h >index 49bafa11df881330b59a7837a80d3f36f6be3201..93da11741cfcf819b35bed30f413d4e7d2afbd16 100644 >--- a/Source/WebKit/Shared/Cocoa/WKNSError.h >+++ b/Source/WebKit/Shared/Cocoa/WKNSError.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2013 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -32,11 +32,9 @@ > > namespace WebKit { > >-inline NSError *wrapper(API::Error& error) >-{ >- ASSERT([error.wrapper() isKindOfClass:[NSError self]]); >- return (NSError *)error.wrapper(); >-} >+template<> struct WrapperTraits<API::Error> { >+ using WrapperClass = NSError; >+}; > > } > >diff --git a/Source/WebKit/Shared/Cocoa/WKNSNumber.h b/Source/WebKit/Shared/Cocoa/WKNSNumber.h >index 5fbe5dd24212b8958e4644958592d2d50de85bd7..4a9c6388df8cc067266f74b5335bbedf3185ff59 100644 >--- a/Source/WebKit/Shared/Cocoa/WKNSNumber.h >+++ b/Source/WebKit/Shared/Cocoa/WKNSNumber.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2016 Apple Inc. All rights reserved. >+ * Copyright (C) 2016-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -31,8 +31,11 @@ > #import "WKObject.h" > > namespace WebKit { >-template<typename NumberType, API::Object::Type APIObjectType> >-inline NSNumber *wrapper(API::Number<NumberType, APIObjectType>& number) { ASSERT([number.wrapper() isKindOfClass:[NSNumber class]]); return (NSNumber *)number.wrapper(); } >+ >+template<typename NumberType, API::Object::Type APIObjectType> struct WrapperTraits<API::Number<NumberType, APIObjectType>> { >+ using WrapperClass = NSNumber; >+}; >+ > } > > @interface WKNSNumber : NSNumber <WKObject> { >diff --git a/Source/WebKit/Shared/Cocoa/WKNSString.h b/Source/WebKit/Shared/Cocoa/WKNSString.h >index f2d90bc05525679ade0489f93a90e6c4bdc6b295..e5919aa6d7c9bc17eef9043ee3a764a2c272340c 100644 >--- a/Source/WebKit/Shared/Cocoa/WKNSString.h >+++ b/Source/WebKit/Shared/Cocoa/WKNSString.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2013 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -31,7 +31,11 @@ > #import "WKObject.h" > > namespace WebKit { >-inline NSString *wrapper(API::String& string) { ASSERT([string.wrapper() isKindOfClass:[NSString class]]); return (NSString *)string.wrapper(); } >+ >+template<> struct WrapperTraits<API::String> { >+ using WrapperClass = NSString; >+}; >+ > } > > @interface WKNSString : WKObject <NSCopying> >diff --git a/Source/WebKit/Shared/Cocoa/WKNSURL.h b/Source/WebKit/Shared/Cocoa/WKNSURL.h >index d1069f8e48e6068f7d3c1f0b8cdec6845cbc7457..2145fee810647f65fb456c3c06bd54496ba0f91f 100644 >--- a/Source/WebKit/Shared/Cocoa/WKNSURL.h >+++ b/Source/WebKit/Shared/Cocoa/WKNSURL.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2013 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -32,11 +32,9 @@ > > namespace WebKit { > >-inline NSURL *wrapper(API::URL& url) >-{ >- ASSERT([url.wrapper() isKindOfClass:[NSURL class]]); >- return (NSURL *)url.wrapper(); >-} >+template<> struct WrapperTraits<API::URL> { >+ using WrapperClass = NSURL; >+}; > > } > >diff --git a/Source/WebKit/Shared/Cocoa/WKNSURLRequest.h b/Source/WebKit/Shared/Cocoa/WKNSURLRequest.h >index 883da162f128627bcdc319bd729187f8b129cf66..d8849666627e1ece5aefa41316b06afeda6a1040 100644 >--- a/Source/WebKit/Shared/Cocoa/WKNSURLRequest.h >+++ b/Source/WebKit/Shared/Cocoa/WKNSURLRequest.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2014-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -32,10 +32,9 @@ > > namespace WebKit { > >-inline NSURLRequest *wrapper(API::URLRequest& request) >-{ >- return (NSURLRequest *)request.wrapper(); >-} >+template<> struct WrapperTraits<API::URLRequest> { >+ using WrapperClass = NSURLRequest; >+}; > > } > >diff --git a/Source/WebKit/Shared/Cocoa/WKObject.h b/Source/WebKit/Shared/Cocoa/WKObject.h >index 1beaa0a9973c2723afd98266849ac3b3fb568648..d7fd714f0e46555e65684e158c33e27a6497ab75 100644 >--- a/Source/WebKit/Shared/Cocoa/WKObject.h >+++ b/Source/WebKit/Shared/Cocoa/WKObject.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2013 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -28,17 +28,18 @@ > #if WK_API_ENABLED > > #import <type_traits> >+#import <wtf/RefPtr.h> > > namespace API { >+ > class Object; > >-template<typename T> >-struct ObjectStorage { >- T* get() { return reinterpret_cast<T*>(&data); } >- T& operator*() { return *reinterpret_cast<T*>(&data); } >- T* operator->() { return reinterpret_cast<T*>(&data); } >+template<typename ObjectClass> struct ObjectStorage { >+ ObjectClass* get() { return reinterpret_cast<ObjectClass*>(&data); } >+ ObjectClass& operator*() { return *get(); } >+ ObjectClass* operator->() { return get(); } > >- typename std::aligned_storage<sizeof(T), std::alignment_of<T>::value>::type data; >+ typename std::aligned_storage<sizeof(ObjectClass), std::alignment_of<ObjectClass>::value>::type data; > }; > > API::Object* unwrap(void*); >@@ -46,6 +47,54 @@ void* wrap(API::Object*); > > } > >+namespace WebKit { >+ >+template<typename WrappedObjectClass> struct WrapperTraits; >+ >+template<typename DestinationClass, typename SourceClass> inline DestinationClass *checkedObjCCast(SourceClass *source) >+{ >+ ASSERT([source isKindOfClass:[DestinationClass class]]); >+ return (DestinationClass *)source; >+} >+ >+template<typename ObjectClass> inline typename WrapperTraits<ObjectClass>::WrapperClass *wrapper(ObjectClass& object) >+{ >+ return checkedObjCCast<typename WrapperTraits<ObjectClass>::WrapperClass>(object.wrapper()); >+} >+ >+template<typename ObjectClass> inline typename WrapperTraits<ObjectClass>::WrapperClass *wrapper(ObjectClass* object) >+{ >+ return object ? wrapper(*object) : nil; >+} >+ >+template<typename ObjectClass> inline typename WrapperTraits<ObjectClass>::WrapperClass *wrapper(const Ref<ObjectClass>& object) >+{ >+ return wrapper(object.get()); >+} >+ >+template<typename ObjectClass> inline typename WrapperTraits<ObjectClass>::WrapperClass *wrapper(const RefPtr<ObjectClass>& object) >+{ >+ return wrapper(object.get()); >+} >+ >+template<typename ObjectClass> inline typename WrapperTraits<ObjectClass>::WrapperClass *wrapper(Ref<ObjectClass>&& object) >+{ >+ return [wrapper(object.leakRef()) autorelease]; >+} >+ >+template<typename ObjectClass> inline typename WrapperTraits<ObjectClass>::WrapperClass *wrapper(RefPtr<ObjectClass>&& object) >+{ >+ return object ? wrapper(object.releaseNonNull()) : nil; >+} >+ >+} >+ >+namespace API { >+ >+using WebKit::wrapper; >+ >+} >+ > @protocol WKObject <NSObject> > > @property (readonly) API::Object& _apiObject; >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKBackForwardListInternal.h b/Source/WebKit/UIProcess/API/Cocoa/WKBackForwardListInternal.h >index 4925a9bfaacbf43b689fcee69d1d21732a220e4c..c15856ac70e9efd22de688ac8bcb2c93f4f80cb1 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKBackForwardListInternal.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKBackForwardListInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2013 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -31,7 +31,11 @@ > #import "WebBackForwardList.h" > > namespace WebKit { >-inline WKBackForwardList *wrapper(WebBackForwardList& list) { ASSERT([list.wrapper() isKindOfClass:[WKBackForwardList class]]); return (WKBackForwardList *)list.wrapper(); } >+ >+template<> struct WrapperTraits<WebBackForwardList> { >+ using WrapperClass = WKBackForwardList; >+}; >+ > } > > @interface WKBackForwardList () <WKObject> >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKBackForwardListItemInternal.h b/Source/WebKit/UIProcess/API/Cocoa/WKBackForwardListItemInternal.h >index 3e9c0ae6e19fe28605747fb3c82889b669193bf6..dfd42d7226928510352c14eaecb2cbe9272a969e 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKBackForwardListItemInternal.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKBackForwardListItemInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2013 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -31,7 +31,11 @@ > #import "WebBackForwardListItem.h" > > namespace WebKit { >-inline WKBackForwardListItem *wrapper(WebBackForwardListItem& item) { ASSERT([item.wrapper() isKindOfClass:[WKBackForwardListItem class]]); return (WKBackForwardListItem *)item.wrapper(); } >+ >+template<> struct WrapperTraits<WebBackForwardListItem> { >+ using WrapperClass = WKBackForwardListItem; >+}; >+ > } > > @interface WKBackForwardListItem () <WKObject> >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKBrowsingContextGroupInternal.h b/Source/WebKit/UIProcess/API/Cocoa/WKBrowsingContextGroupInternal.h >index 7bd2c725118f3523c44bd99763f998b1e86a54c7..c88652a079b79520f485f443771efe53b0d2affb 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKBrowsingContextGroupInternal.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKBrowsingContextGroupInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2013 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -32,11 +32,9 @@ > > namespace WebKit { > >-inline WKBrowsingContextGroup *wrapper(WebPageGroup& pageGroup) >-{ >- ASSERT([pageGroup.wrapper() isKindOfClass:[WKBrowsingContextGroup class]]); >- return (WKBrowsingContextGroup *)pageGroup.wrapper(); >-} >+template<> struct WrapperTraits<WebPageGroup> { >+ using WrapperClass = WKBrowsingContextGroup; >+}; > > } > >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKConnectionInternal.h b/Source/WebKit/UIProcess/API/Cocoa/WKConnectionInternal.h >index 5e4d7d88eeefd6f2d7902835a06755e464624884..16fce5d50bf43723e0827ad454f836c371508b4c 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKConnectionInternal.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKConnectionInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2011 Apple Inc. All rights reserved. >+ * Copyright (C) 2011-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -32,11 +32,9 @@ > > namespace WebKit { > >-inline WKConnection *wrapper(WebConnection& connection) >-{ >- ASSERT([connection.wrapper() isKindOfClass:[WKConnection class]]); >- return (WKConnection *)connection.wrapper(); >-} >+template<> struct WrapperTraits<WebConnection> { >+ using WrapperClass = WKConnection; >+}; > > } > >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKContentRuleListInternal.h b/Source/WebKit/UIProcess/API/Cocoa/WKContentRuleListInternal.h >index a65937a3d2d8b5961414a733c80cc1ee979df0ff..da2e3268e8b56a0b946934ce9d26d71bfa127fbd 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKContentRuleListInternal.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKContentRuleListInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2017 Apple Inc. All rights reserved. >+ * Copyright (C) 2017-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -32,11 +32,9 @@ > > namespace WebKit { > >-inline WKContentRuleList *wrapper(API::ContentRuleList& contentRuleList) >-{ >- ASSERT([contentRuleList.wrapper() isKindOfClass:[WKContentRuleList class]]); >- return (WKContentRuleList *)contentRuleList.wrapper(); >-} >+template<> struct WrapperTraits<API::ContentRuleList> { >+ using WrapperClass = WKContentRuleList; >+}; > > } > >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKContentRuleListStoreInternal.h b/Source/WebKit/UIProcess/API/Cocoa/WKContentRuleListStoreInternal.h >index 513e356787a5012fd51fcf7f0ea2f5644b533f25..7e24727452a54bd00642c56da61c15bcdd7c3693 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKContentRuleListStoreInternal.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKContentRuleListStoreInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2017 Apple Inc. All rights reserved. >+ * Copyright (C) 2017-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -32,11 +32,9 @@ > > namespace WebKit { > >-inline WKContentRuleListStore *wrapper(API::ContentRuleListStore& store) >-{ >- ASSERT([store.wrapper() isKindOfClass:[WKContentRuleListStore class]]); >- return (WKContentRuleListStore *)store.wrapper(); >-} >+template<> struct WrapperTraits<API::ContentRuleListStore> { >+ using WrapperClass = WKContentRuleListStore; >+}; > > } > >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKFrameInfoInternal.h b/Source/WebKit/UIProcess/API/Cocoa/WKFrameInfoInternal.h >index b1683bbf8fbbad1023f01227fc2f19a07fbd1c4e..4df4761a8b48ba0908e0b715c32d12f61fe2d047 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKFrameInfoInternal.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKFrameInfoInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2014-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -30,14 +30,11 @@ > #import "APIFrameInfo.h" > #import "WKObject.h" > >-namespace API { >+namespace WebKit { > >-inline WKFrameInfo *wrapper(API::FrameInfo& frameInfo) >-{ >- ASSERT([frameInfo.wrapper() isKindOfClass:[WKFrameInfo class]]); >- >- return (WKFrameInfo *)frameInfo.wrapper(); >-} >+template<> struct WrapperTraits<API::FrameInfo> { >+ using WrapperClass = WKFrameInfo; >+}; > > } > >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKHTTPCookieStoreInternal.h b/Source/WebKit/UIProcess/API/Cocoa/WKHTTPCookieStoreInternal.h >index 341b32baef2816174e54db60e061e53fecf8ea67..8bdec8e607d1f48a3efcb2303a29cfcc5d0a9d5b 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKHTTPCookieStoreInternal.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKHTTPCookieStoreInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2017 Apple Inc. All rights reserved. >+ * Copyright (C) 2017-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -32,11 +32,9 @@ > > namespace WebKit { > >-inline WKHTTPCookieStore *wrapper(API::HTTPCookieStore& cookieStore) >-{ >- ASSERT([cookieStore.wrapper() isKindOfClass:[WKHTTPCookieStore class]]); >- return (WKHTTPCookieStore *)cookieStore.wrapper(); >-} >+template<> struct WrapperTraits<API::HTTPCookieStore> { >+ using WrapperClass = WKHTTPCookieStore; >+}; > > } > >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKNSURLAuthenticationChallenge.h b/Source/WebKit/UIProcess/API/Cocoa/WKNSURLAuthenticationChallenge.h >index 1e2ec503afdae5a9ad1609a5fd9b6f081958c971..8f79e6e9ab2815e53eb1b0bc553df2e1262f2d6d 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKNSURLAuthenticationChallenge.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKNSURLAuthenticationChallenge.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2013 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -32,11 +32,9 @@ > > namespace WebKit { > >-inline NSURLAuthenticationChallenge *wrapper(AuthenticationChallengeProxy& challenge) >-{ >- ASSERT([challenge.wrapper() isKindOfClass:[NSURLAuthenticationChallenge self]]); >- return (NSURLAuthenticationChallenge *)challenge.wrapper(); >-} >+template<> struct WrapperTraits<AuthenticationChallengeProxy> { >+ using WrapperClass = NSURLAuthenticationChallenge; >+}; > > } > >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKNavigationActionInternal.h b/Source/WebKit/UIProcess/API/Cocoa/WKNavigationActionInternal.h >index a959d5d9ccecb765025ce9e310e3460eea29c4df..60f6f1a23bd96a0be9def12a9cab9810ac588d2b 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKNavigationActionInternal.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKNavigationActionInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2014-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -30,14 +30,11 @@ > #import "APINavigationAction.h" > #import "WKObject.h" > >-namespace API { >+namespace WebKit { > >-inline WKNavigationAction *wrapper(API::NavigationAction& navigationAction) >-{ >- ASSERT([navigationAction.wrapper() isKindOfClass:[WKNavigationAction class]]); >- >- return (WKNavigationAction *)navigationAction.wrapper(); >-} >+template<> struct WrapperTraits<API::NavigationAction> { >+ using WrapperClass = WKNavigationAction; >+}; > > } > >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKNavigationDataInternal.h b/Source/WebKit/UIProcess/API/Cocoa/WKNavigationDataInternal.h >index 6bad6e0711cf32442122358d5976b863717177df..5526cd4f17b24962d4021dd4dbe0c47661e21bfd 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKNavigationDataInternal.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKNavigationDataInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2013 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -32,12 +32,9 @@ > > namespace WebKit { > >-inline WKNavigationData *wrapper(API::NavigationData& data) >-{ >- ASSERT([data.wrapper() isKindOfClass:[WKNavigationData class]]); >- >- return (WKNavigationData *)data.wrapper(); >-} >+template<> struct WrapperTraits<API::NavigationData> { >+ using WrapperClass = WKNavigationData; >+}; > > } > >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKNavigationInternal.h b/Source/WebKit/UIProcess/API/Cocoa/WKNavigationInternal.h >index 5c160cf103b9cfe561b576117eff51aebfe51058..3be986791291c5b5591b87f16cb9ee6a419f86b5 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKNavigationInternal.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKNavigationInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2014-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -30,14 +30,11 @@ > #import "APINavigation.h" > #import "WKObject.h" > >-namespace API { >+namespace WebKit { > >-inline WKNavigation *wrapper(API::Navigation& navigation) >-{ >- ASSERT([navigation.wrapper() isKindOfClass:[WKNavigation class]]); >- >- return (WKNavigation *)navigation.wrapper(); >-} >+template<> struct WrapperTraits<API::Navigation> { >+ using WrapperClass = WKNavigation; >+}; > > } > >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKNavigationResponseInternal.h b/Source/WebKit/UIProcess/API/Cocoa/WKNavigationResponseInternal.h >index 2f69645ceaa778d955799f9917dfa1371f19a732..28e4a6358bdaa8120a917342a3bcad1efcc753fb 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKNavigationResponseInternal.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKNavigationResponseInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2014-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -30,14 +30,11 @@ > #import "APINavigationResponse.h" > #import "WKObject.h" > >-namespace API { >+namespace WebKit { > >-inline WKNavigationResponse *wrapper(API::NavigationResponse& navigationResponse) >-{ >- ASSERT([navigationResponse.wrapper() isKindOfClass:[WKNavigationResponse class]]); >- >- return (WKNavigationResponse *)navigationResponse.wrapper(); >-} >+template<> struct WrapperTraits<API::NavigationResponse> { >+ using WrapperClass = WKNavigationResponse; >+}; > > } > >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKOpenPanelParametersInternal.h b/Source/WebKit/UIProcess/API/Cocoa/WKOpenPanelParametersInternal.h >index 3d6b41dfe7a10e27f3ec996a12cac021f3fcaffa..229a0b2ff3f20eab3303409cd3ea651469e38a69 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKOpenPanelParametersInternal.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKOpenPanelParametersInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2016 Apple Inc. All rights reserved. >+ * Copyright (C) 2016-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -30,14 +30,11 @@ > #import "APIOpenPanelParameters.h" > #import "WKObject.h" > >-namespace API { >+namespace WebKit { > >-inline WKOpenPanelParameters *wrapper(OpenPanelParameters& openPanelParameters) >-{ >- ASSERT([openPanelParameters.wrapper() isKindOfClass:[WKOpenPanelParameters class]]); >- >- return (WKOpenPanelParameters *)openPanelParameters.wrapper(); >-} >+template<> struct WrapperTraits<API::OpenPanelParameters> { >+ using WrapperClass = WKOpenPanelParameters; >+}; > > } > >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesInternal.h b/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesInternal.h >index 20733f41a08bc3019dc191e51d14710eaa88c26b..dab389b20a681b95b3b7d26cc756f3da1cd950b2 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesInternal.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2014-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -32,11 +32,9 @@ > > namespace WebKit { > >-inline WKPreferences *wrapper(WebPreferences& preferences) >-{ >- ASSERT([preferences.wrapper() isKindOfClass:[WKPreferences class]]); >- return (WKPreferences *)preferences.wrapper(); >-} >+template<> struct WrapperTraits<WebPreferences> { >+ using WrapperClass = WKPreferences; >+}; > > } > >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKProcessPoolInternal.h b/Source/WebKit/UIProcess/API/Cocoa/WKProcessPoolInternal.h >index 94548090a1963fcf1dd88831f86419cb68adbf69..58981eda84ce7def33cff9253dbf3011650cf004 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKProcessPoolInternal.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKProcessPoolInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2014-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -36,11 +36,9 @@ > > namespace WebKit { > >-inline WKProcessPool *wrapper(WebProcessPool& processPool) >-{ >- ASSERT([processPool.wrapper() isKindOfClass:[WKProcessPool class]]); >- return (WKProcessPool *)processPool.wrapper(); >-} >+template<> struct WrapperTraits<WebProcessPool> { >+ using WrapperClass = WKProcessPool; >+}; > > } > >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKSecurityOriginInternal.h b/Source/WebKit/UIProcess/API/Cocoa/WKSecurityOriginInternal.h >index a29515436287f04c8ee3ff3a1b2904c1785baacb..1ed6ca59f477ceccd7d5a29908ee88bc124e7c76 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKSecurityOriginInternal.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKSecurityOriginInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2015 Apple Inc. All rights reserved. >+ * Copyright (C) 2015-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -29,13 +29,11 @@ > > #import "APISecurityOrigin.h" > >-namespace API { >+namespace WebKit { > >-inline WKSecurityOrigin *wrapper(API::SecurityOrigin& securityOrigin) >-{ >- ASSERT([securityOrigin.wrapper() isKindOfClass:[WKSecurityOrigin self]]); >- return (WKSecurityOrigin *)securityOrigin.wrapper(); >-} >+template<> struct WrapperTraits<API::SecurityOrigin> { >+ using WrapperClass = WKSecurityOrigin; >+}; > > } > >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKUserContentControllerInternal.h b/Source/WebKit/UIProcess/API/Cocoa/WKUserContentControllerInternal.h >index b78e19c07076980d5208404db9cd66c02be0b4e6..1619cca0e79b9d54b54d3f454cc60bc929d87861 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKUserContentControllerInternal.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKUserContentControllerInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2014-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -32,13 +32,9 @@ > > namespace WebKit { > >-class WebUserContentControllerProxy; >- >-inline WKUserContentController *wrapper(WebUserContentControllerProxy& userContentController) >-{ >- ASSERT([userContentController.wrapper() isKindOfClass:[WKUserContentController class]]); >- return (WKUserContentController *)userContentController.wrapper(); >-} >+template<> struct WrapperTraits<WebUserContentControllerProxy> { >+ using WrapperClass = WKUserContentController; >+}; > > } > >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKUserScriptInternal.h b/Source/WebKit/UIProcess/API/Cocoa/WKUserScriptInternal.h >index c6d581b2ee5cc3a17291873efdc696fff5e06c33..b2be26952f5cbca2bccd8e008c856c8011f3b072 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKUserScriptInternal.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKUserScriptInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2014-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -29,14 +29,16 @@ > > #import "APIUserScript.h" > >-namespace API { >+namespace WebKit { >+ >+template<> struct WrapperTraits<API::UserScript> { >+ using WrapperClass = WKUserScript; >+}; > >-inline WKUserScript *wrapper(UserScript& userScript) >-{ >- ASSERT([userScript.wrapper() isKindOfClass:[WKUserScript class]]); >- return (WKUserScript *)userScript.wrapper(); > } > >+namespace API { >+ > inline WebCore::UserScriptInjectionTime toWebCoreUserScriptInjectionTime(WKUserScriptInjectionTime injectionTime) > { > switch (injectionTime) { >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h b/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h >index 7a8042a6dd9f6d76db2a543c5c6e0a88fefd78ce..64eaaf1e2b4350107e86c451cacd7a5525936de4 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2015-2017 Apple Inc. All rights reserved. >+ * Copyright (C) 2015-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -34,11 +34,9 @@ > > namespace WebKit { > >-inline WKWebsiteDataRecord *wrapper(API::WebsiteDataRecord& websiteDataRecord) >-{ >- ASSERT([websiteDataRecord.wrapper() isKindOfClass:[WKWebsiteDataRecord class]]); >- return (WKWebsiteDataRecord *)websiteDataRecord.wrapper(); >-} >+template<> struct WrapperTraits<API::WebsiteDataRecord> { >+ using WrapperClass = WKWebsiteDataRecord; >+}; > > static inline std::optional<WebsiteDataType> toWebsiteDataType(NSString *websiteDataType) > { >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStoreInternal.h b/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStoreInternal.h >index 9d39c8aa7d8d335236480204501e17d052e90681..d861875273ba7df67e2866d1455b96b7f3dc47f6 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStoreInternal.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStoreInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2014-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -32,11 +32,9 @@ > > namespace WebKit { > >-inline WKWebsiteDataStore *wrapper(API::WebsiteDataStore& websiteDataStore) >-{ >- ASSERT([websiteDataStore.wrapper() isKindOfClass:[WKWebsiteDataStore class]]); >- return (WKWebsiteDataStore *)websiteDataStore.wrapper(); >-} >+template<> struct WrapperTraits<API::WebsiteDataStore> { >+ using WrapperClass = WKWebsiteDataStore; >+}; > > } > >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWindowFeaturesInternal.h b/Source/WebKit/UIProcess/API/Cocoa/WKWindowFeaturesInternal.h >index 767bbd3527c27d21b33efecee6c32afb4e1aafca..23b22038664943342bf632e9692b3f7e9ac24759 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKWindowFeaturesInternal.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKWindowFeaturesInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2014-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -32,14 +32,12 @@ > > namespace WebKit { > >-inline WKWindowFeatures *wrapper(API::WindowFeatures& windowFeatures) >-{ >- ASSERT([windowFeatures.wrapper() isKindOfClass:[WKWindowFeatures class]]); >+template<> struct WrapperTraits<API::WindowFeatures> { >+ using WrapperClass = WKWindowFeatures; >+}; > >- return (WKWindowFeatures *)windowFeatures.wrapper(); > } > >-} > @interface WKWindowFeatures () <WKObject> { > @package > API::ObjectStorage<API::WindowFeatures> _windowFeatures; >diff --git a/Source/WebKit/UIProcess/API/Cocoa/_WKApplicationManifestInternal.h b/Source/WebKit/UIProcess/API/Cocoa/_WKApplicationManifestInternal.h >index 6a7c109cf9ced380fc25beda336dfe1ac1dd5ae5..e60cc5d6fe3a0c06ae92375057a52cb479d869bd 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/_WKApplicationManifestInternal.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/_WKApplicationManifestInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2017 Apple Inc. All rights reserved. >+ * Copyright (C) 2017-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -23,24 +23,20 @@ > * THE POSSIBILITY OF SUCH DAMAGE. > */ > >-#pragma once >- > #import <WebKit/WKFoundation.h> > > #if WK_API_ENABLED > > #import "APIApplicationManifest.h" > #import "_WKApplicationManifest.h" >-#import <WebCore/ApplicationManifest.h> > > #if ENABLE(APPLICATION_MANIFEST) >-namespace API { > >-inline _WKApplicationManifest *wrapper(API::ApplicationManifest& applicationManifest) >-{ >- ASSERT([applicationManifest.wrapper() isKindOfClass:[_WKApplicationManifest class]]); >- return (_WKApplicationManifest *)applicationManifest.wrapper(); >-} >+namespace WebKit { >+ >+template<> struct WrapperTraits<API::ApplicationManifest> { >+ using WrapperClass = _WKApplicationManifest; >+}; > > } > >diff --git a/Source/WebKit/UIProcess/API/Cocoa/_WKAttachmentInternal.h b/Source/WebKit/UIProcess/API/Cocoa/_WKAttachmentInternal.h >index 2e53ecba3954ab6416cd4cd2cdf14aee5a94d51a..138a9537a8150c46f60a7afd03bcd19afe19b708 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/_WKAttachmentInternal.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/_WKAttachmentInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2017 Apple Inc. All rights reserved. >+ * Copyright (C) 2017-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -23,18 +23,14 @@ > * THE POSSIBILITY OF SUCH DAMAGE. > */ > >-#pragma once >- > #import "APIAttachment.h" > #import "_WKAttachment.h" > >-namespace API { >+namespace WebKit { > >-inline _WKAttachment *wrapper(API::Attachment& attachment) >-{ >- ASSERT([attachment.wrapper() isKindOfClass:[_WKAttachment class]]); >- return (_WKAttachment *)attachment.wrapper(); >-} >+template<> struct WrapperTraits<API::Attachment> { >+ using WrapperClass = _WKAttachment; >+}; > > } > >diff --git a/Source/WebKit/UIProcess/API/Cocoa/_WKAutomationSessionInternal.h b/Source/WebKit/UIProcess/API/Cocoa/_WKAutomationSessionInternal.h >index aca7a7f29fe8c4ce3d9ecbd9cbc2e364132f5b8d..af94304f57a63b33ae2b07e4c2901a051f441277 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/_WKAutomationSessionInternal.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/_WKAutomationSessionInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2016 Apple Inc. All rights reserved. >+ * Copyright (C) 2016-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -30,10 +30,12 @@ > #import "WKObject.h" > #import "WebAutomationSession.h" > >-inline _WKAutomationSession *wrapper(WebKit::WebAutomationSession& session) >-{ >- ASSERT([session.wrapper() isKindOfClass:[_WKAutomationSession class]]); >- return (_WKAutomationSession *)session.wrapper(); >+namespace WebKit { >+ >+template<> struct WrapperTraits<WebAutomationSession> { >+ using WrapperClass = _WKAutomationSession; >+}; >+ > } > > @interface _WKAutomationSession () <WKObject> { >diff --git a/Source/WebKit/UIProcess/API/Cocoa/_WKExperimentalFeatureInternal.h b/Source/WebKit/UIProcess/API/Cocoa/_WKExperimentalFeatureInternal.h >index 9eb1dd14dea5829cfb86d7aae0c7b47032a33f08..912df89ce285d8a6cc8de7638193117baa923815 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/_WKExperimentalFeatureInternal.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/_WKExperimentalFeatureInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2016 Apple Inc. All rights reserved. >+ * Copyright (C) 2016-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -32,11 +32,9 @@ > > namespace WebKit { > >-inline _WKExperimentalFeature *wrapper(API::ExperimentalFeature& experimentalFeature) >-{ >- ASSERT([experimentalFeature.wrapper() isKindOfClass:[_WKExperimentalFeature class]]); >- return (_WKExperimentalFeature *)experimentalFeature.wrapper(); >-} >+template<> struct WrapperTraits<API::ExperimentalFeature> { >+ using WrapperClass = _WKExperimentalFeature; >+}; > > } > >diff --git a/Source/WebKit/UIProcess/API/Cocoa/_WKGeolocationPositionInternal.h b/Source/WebKit/UIProcess/API/Cocoa/_WKGeolocationPositionInternal.h >index 71a3579e8a8659b1c82438578cd7f94462b8805e..734b2aef13a87b98d7175c24adabcf40ffb21e20 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/_WKGeolocationPositionInternal.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/_WKGeolocationPositionInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2017 Apple Inc. All rights reserved. >+ * Copyright (C) 2017-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -31,11 +31,9 @@ > > namespace WebKit { > >-inline _WKGeolocationPosition *wrapper(WebKit::WebGeolocationPosition &position) >-{ >- ASSERT([position.wrapper() isKindOfClass:[_WKGeolocationPosition class]]); >- return (_WKGeolocationPosition *)position.wrapper(); >-} >+template<> struct WrapperTraits<WebGeolocationPosition> { >+ using WrapperClass = _WKGeolocationPosition; >+}; > > } > >diff --git a/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfigurationInternal.h b/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfigurationInternal.h >index cb8bc1794a684097751f9aeb74e0b72332e6c844..d52074850934fe6b78a2af63db0c9d035b2d8ed6 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfigurationInternal.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfigurationInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2015 Apple Inc. All rights reserved. >+ * Copyright (C) 2015-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -30,13 +30,11 @@ > #import "APIProcessPoolConfiguration.h" > #import "WKObject.h" > >-namespace API { >+namespace WebKit { > >-inline _WKProcessPoolConfiguration *wrapper(API::ProcessPoolConfiguration& processPoolConfiguration) >-{ >- ASSERT([processPoolConfiguration.wrapper() isKindOfClass:[_WKProcessPoolConfiguration class]]); >- return (_WKProcessPoolConfiguration *)processPoolConfiguration.wrapper(); >-} >+template<> struct WrapperTraits<API::ProcessPoolConfiguration> { >+ using WrapperClass = _WKProcessPoolConfiguration; >+}; > > } > >diff --git a/Source/WebKit/UIProcess/API/Cocoa/_WKUserContentWorldInternal.h b/Source/WebKit/UIProcess/API/Cocoa/_WKUserContentWorldInternal.h >index e83c5a8ac44bc0b87e37824a743ff9ed7c221c74..3ee6d7f3e40c772007fc722389d121d10121b74d 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/_WKUserContentWorldInternal.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/_WKUserContentWorldInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2016 Apple Inc. All rights reserved. >+ * Copyright (C) 2016-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -32,14 +32,16 @@ > #import <wtf/Vector.h> > #import <wtf/text/WTFString.h> > >-namespace API { >+namespace WebKit { >+ >+template<> struct WrapperTraits<API::UserContentWorld> { >+ using WrapperClass = _WKUserContentWorld; >+}; > >-inline _WKUserContentWorld *wrapper(UserContentWorld& userContentWorld) >-{ >- ASSERT([userContentWorld.wrapper() isKindOfClass:[_WKUserContentWorld class]]); >- return (_WKUserContentWorld *)userContentWorld.wrapper(); > } > >+namespace API { >+ > inline Vector<WTF::String> toStringVector(NSArray *input) > { > Vector<WTF::String> vector; >diff --git a/Source/WebKit/UIProcess/API/Cocoa/_WKUserInitiatedActionInternal.h b/Source/WebKit/UIProcess/API/Cocoa/_WKUserInitiatedActionInternal.h >index f5603838578224cd9ef49f713b65890298e9bc84..e91a1ad7b1a21c21b338781659e15aac4b573d97 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/_WKUserInitiatedActionInternal.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/_WKUserInitiatedActionInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2016 Apple Inc. All rights reserved. >+ * Copyright (C) 2016-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -29,15 +29,12 @@ > > #import "APIUserInitiatedAction.h" > #import "WKObject.h" >-#import <wtf/text/WTFString.h> > >-namespace API { >+namespace WebKit { > >-inline _WKUserInitiatedAction *wrapper(UserInitiatedAction& userInitiatedAction) >-{ >- ASSERT([userInitiatedAction.wrapper() isKindOfClass:[_WKUserInitiatedAction class]]); >- return (_WKUserInitiatedAction *)userInitiatedAction.wrapper(); >-} >+template<> struct WrapperTraits<API::UserInitiatedAction> { >+ using WrapperClass = _WKUserInitiatedAction; >+}; > > } > >diff --git a/Source/WebKit/UIProcess/API/Cocoa/_WKUserStyleSheetInternal.h b/Source/WebKit/UIProcess/API/Cocoa/_WKUserStyleSheetInternal.h >index 1ad1bf0b8676c272b8f3374f23e6c7ca2b0ce6da..2ed47aa14ada4318fe3b28a2f33efbbad202464a 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/_WKUserStyleSheetInternal.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/_WKUserStyleSheetInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2015 Apple Inc. All rights reserved. >+ * Copyright (C) 2015-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -29,13 +29,11 @@ > > #import "APIUserStyleSheet.h" > >-namespace API { >+namespace WebKit { > >-inline _WKUserStyleSheet *wrapper(UserStyleSheet& userStyleSheet) >-{ >- ASSERT([userStyleSheet.wrapper() isKindOfClass:[_WKUserStyleSheet class]]); >- return (_WKUserStyleSheet *)userStyleSheet.wrapper(); >-} >+template<> struct WrapperTraits<API::UserStyleSheet> { >+ using WrapperClass = _WKUserStyleSheet; >+}; > > } > >diff --git a/Source/WebKit/UIProcess/API/Cocoa/_WKVisitedLinkStoreInternal.h b/Source/WebKit/UIProcess/API/Cocoa/_WKVisitedLinkStoreInternal.h >index b0eea40b2cac92fefc6812ca7b56930f2e6a0791..9e70cd8a7020d9c91fef43af36bb12ff38b23b6a 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/_WKVisitedLinkStoreInternal.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/_WKVisitedLinkStoreInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2014-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -32,11 +32,9 @@ > > namespace WebKit { > >-inline _WKVisitedLinkStore *wrapper(VisitedLinkStore& visitedLinkStore) >-{ >- ASSERT([visitedLinkStore.wrapper() isKindOfClass:[_WKVisitedLinkStore class]]); >- return (_WKVisitedLinkStore *)visitedLinkStore.wrapper(); >-} >+template<> struct WrapperTraits<VisitedLinkStore> { >+ using WrapperClass = _WKVisitedLinkStore; >+}; > > } > >diff --git a/Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h b/Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h >index 7540626e26b92c571dc25cbd502379890712fd5a..ef0054dc3bbd1fde35636ebec3c8b55fcdf56dce 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h >@@ -30,13 +30,11 @@ > #import "APIWebsitePolicies.h" > #import "WKObject.h" > >-namespace API { >+namespace WebKit { > >-inline _WKWebsitePolicies *wrapper(WebsitePolicies& websitePolicies) >-{ >- ASSERT([websitePolicies.wrapper() isKindOfClass:[_WKWebsitePolicies class]]); >- return (_WKWebsitePolicies *)websitePolicies.wrapper(); >-} >+template<> struct WrapperTraits<API::WebsitePolicies> { >+ using WrapperClass = _WKWebsitePolicies; >+}; > > } > >diff --git a/Source/WebKit/UIProcess/Cocoa/DownloadClient.mm b/Source/WebKit/UIProcess/Cocoa/DownloadClient.mm >index 31e16e4a358789e19ede92d0cd97e12a8a3591f2..0eb1cf6403286861aa4274dfc744843f0bd00a6a 100644 >--- a/Source/WebKit/UIProcess/Cocoa/DownloadClient.mm >+++ b/Source/WebKit/UIProcess/Cocoa/DownloadClient.mm >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2014 Apple Inc. All rights reserved. >+ * Copyright (C) 2014-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -48,11 +48,9 @@ > > namespace WebKit { > >-static inline _WKDownload *wrapper(DownloadProxy& download) >-{ >- ASSERT([download.wrapper() isKindOfClass:[_WKDownload class]]); >- return (_WKDownload *)download.wrapper(); >-} >+template<> struct WrapperTraits<DownloadProxy> { >+ using WrapperClass = _WKDownload; >+}; > > DownloadClient::DownloadClient(id <_WKDownloadDelegate> delegate) > : m_delegate(delegate) >diff --git a/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrameInternal.h b/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrameInternal.h >index 4a97d37df10b7ae1fee09c37cd18869c097363b2..95238da1b06de69858e4095026e01bb058ea386e 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrameInternal.h >+++ b/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrameInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2013 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -33,10 +33,10 @@ > > namespace WebKit { > >-inline WKWebProcessPlugInFrame *wrapper(WebFrame& frame) >-{ >- ASSERT([frame.wrapper() isKindOfClass:[WKWebProcessPlugInFrame class]]); >- return (WKWebProcessPlugInFrame *)frame.wrapper(); } >+template<> struct WrapperTraits<WebFrame> { >+ using WrapperClass = WKWebProcessPlugInFrame; >+}; >+ > } > > @interface WKWebProcessPlugInFrame () <WKObject> >diff --git a/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInHitTestResultInternal.h b/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInHitTestResultInternal.h >index 3f255fd27a5522426dcb2f007d1d27a4a3f7c7e1..3d283bd9c998368cd5c9b1960dc7692e6c6b2f8f 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInHitTestResultInternal.h >+++ b/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInHitTestResultInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2013 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -32,11 +32,9 @@ > > namespace WebKit { > >-inline WKWebProcessPlugInHitTestResult *wrapper(InjectedBundleHitTestResult& hitTestResult) >-{ >- ASSERT([hitTestResult.wrapper() isKindOfClass:[WKWebProcessPlugInHitTestResult class]]); >- return (WKWebProcessPlugInHitTestResult *)hitTestResult.wrapper(); >-} >+template<> struct WrapperTraits<InjectedBundleHitTestResult> { >+ using WrapperClass = WKWebProcessPlugInHitTestResult; >+}; > > } > >diff --git a/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandleInternal.h b/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandleInternal.h >index 89d3e03c084b2b955019e09a75ca510ed985b4c0..9f99772d58157d565cc4e54f08c5af4dc353839a 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandleInternal.h >+++ b/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandleInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2013 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -32,11 +32,9 @@ > > namespace WebKit { > >-inline WKWebProcessPlugInNodeHandle *wrapper(InjectedBundleNodeHandle& nodeHandle) >-{ >- ASSERT([nodeHandle.wrapper() isKindOfClass:[WKWebProcessPlugInNodeHandle class]]); >- return (WKWebProcessPlugInNodeHandle *)nodeHandle.wrapper(); >-} >+template<> struct WrapperTraits<InjectedBundleNodeHandle> { >+ using WrapperClass = WKWebProcessPlugInNodeHandle; >+}; > > } > >diff --git a/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroupInternal.h b/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroupInternal.h >index c1eeb52bc8759623a7a17c1c6e6a70b00bf820df..e94e34803942a55c30c8d4cd15ed42f93143b848 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroupInternal.h >+++ b/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroupInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2013 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -32,12 +32,10 @@ > > namespace WebKit { > >-inline WKWebProcessPlugInPageGroup *wrapper(WebPageGroupProxy& pageGroup) >-{ >- ASSERT([pageGroup.wrapper() isKindOfClass:[WKWebProcessPlugInPageGroup class]]); >- return (WKWebProcessPlugInPageGroup *)pageGroup.wrapper(); >-} >- >+template<> struct WrapperTraits<WebPageGroupProxy> { >+ using WrapperClass = WKWebProcessPlugInPageGroup; >+}; >+ > } > > @interface WKWebProcessPlugInPageGroup () <WKObject> >diff --git a/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandleInternal.h b/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandleInternal.h >index 306cf24f748740afbab1e7370168f21e808f4e50..31cabbba006a431df88054ff77e3989801fb388a 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandleInternal.h >+++ b/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandleInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2016 Apple Inc. All rights reserved. >+ * Copyright (C) 2016-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -32,11 +32,9 @@ > > namespace WebKit { > >-inline WKWebProcessPlugInRangeHandle *wrapper(InjectedBundleRangeHandle& rangeHandle) >-{ >- ASSERT([rangeHandle.wrapper() isKindOfClass:[WKWebProcessPlugInRangeHandle class]]); >- return (WKWebProcessPlugInRangeHandle *)rangeHandle.wrapper(); >-} >+template<> struct WrapperTraits<InjectedBundleRangeHandle> { >+ using WrapperClass = WKWebProcessPlugInRangeHandle; >+}; > > } > >diff --git a/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorldInternal.h b/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorldInternal.h >index d77a7fb97445b3858af9e955c73c0eb3e7897de2..f29e66adb6fd1077bd6bce1dd208361c90734663 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorldInternal.h >+++ b/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorldInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2013 Apple Inc. All rights reserved. >+ * Copyright (C) 2013-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -32,11 +32,9 @@ > > namespace WebKit { > >-inline WKWebProcessPlugInScriptWorld *wrapper(InjectedBundleScriptWorld& world) >-{ >- ASSERT([world.wrapper() isKindOfClass:[WKWebProcessPlugInScriptWorld class]]); >- return (WKWebProcessPlugInScriptWorld *)world.wrapper(); >-} >+template<> struct WrapperTraits<InjectedBundleScriptWorld> { >+ using WrapperClass = WKWebProcessPlugInScriptWorld; >+}; > > } > >diff --git a/Source/WebKit/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerInternal.h b/Source/WebKit/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerInternal.h >index 7495e375134c5aabb369690b014b9d3f5c7a5d97..1a215091845154e0caa4b80b441bd9decf2ef5f0 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerInternal.h >+++ b/Source/WebKit/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2012 Apple Inc. All rights reserved. >+ * Copyright (C) 2012-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -32,11 +32,9 @@ > > namespace WebKit { > >-inline WKWebProcessPlugInBrowserContextController *wrapper(WebPage& page) >-{ >- ASSERT([page.wrapper() isKindOfClass:[WKWebProcessPlugInBrowserContextController class]]); >- return (WKWebProcessPlugInBrowserContextController *)page.wrapper(); >-} >+template<> struct WrapperTraits<WebPage> { >+ using WrapperClass = WKWebProcessPlugInBrowserContextController; >+}; > > } > >diff --git a/Source/WebKit/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInInternal.h b/Source/WebKit/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInInternal.h >index dc8ea02ccd1421fd603678ba3e3be4e238c7a621..64474685941d2a9b49ff9518070ea9df95b38642 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInInternal.h >+++ b/Source/WebKit/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInInternal.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2012 Apple Inc. All rights reserved. >+ * Copyright (C) 2012-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -32,11 +32,9 @@ > > namespace WebKit { > >-inline WKWebProcessPlugInController *wrapper(InjectedBundle& bundle) >-{ >- ASSERT([bundle.wrapper() isKindOfClass:[WKWebProcessPlugInController class]]); >- return (WKWebProcessPlugInController *)bundle.wrapper(); >-} >+template<> struct WrapperTraits<InjectedBundle> { >+ using WrapperClass = WKWebProcessPlugInController; >+}; > > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
sam
:
review+
darin
:
commit-queue+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188733
: 347462 |
347467