WebKit Bugzilla
Attachment 346629 Details for
Bug 188245
: [Cocoa] More tweaks and refactoring to prepare for ARC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188245-20180806091611.patch (text/plain), 84.00 KB, created by
Darin Adler
on 2018-08-06 09:16:12 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Darin Adler
Created:
2018-08-06 09:16:12 PDT
Size:
84.00 KB
patch
obsolete
>Subversion Revision: 234602 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index f9e61d61e6cc925044f863bc4e228dd6951570f9..9d91b34241c3414c613f8211cf01102d0772b863 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,18 @@ >+2018-08-05 Darin Adler <darin@apple.com> >+ >+ [Cocoa] More tweaks and refactoring to prepare for ARC >+ https://bugs.webkit.org/show_bug.cgi?id=188245 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * API/JSValue.mm: Use __unsafe_unretained. >+ (JSContainerConvertor::convert): Use auto for compatibility with the above. >+ * API/JSWrapperMap.mm: >+ (allocateConstructorForCustomClass): Use CFTypeRef instead of Protocol *. >+ (-[JSWrapperMap initWithGlobalContextRef:]): Use __unsafe_unretained. >+ >+ * heap/Heap.cpp: Updated include for rename: FoundationSPI.h -> objcSPI.h. >+ > 2018-08-04 David Kilzer <ddkilzer@apple.com> > > REGRESSION (r208953): TemplateObjectDescriptor constructor calculates m_hash on use-after-move variable >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index f0e47f384ce5e3d251afcda1a3b025c8bc247ae6..1e328490a8b9aae3614c00d8488431de6d08f192 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,31 @@ >+2018-08-05 Darin Adler <darin@apple.com> >+ >+ [Cocoa] More tweaks and refactoring to prepare for ARC >+ https://bugs.webkit.org/show_bug.cgi?id=188245 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WTF.xcodeproj/project.pbxproj: Updated for rename: FoundationSPI.h -> objcSPI.h. >+ >+ * wtf/BlockPtr.h: Added missing include of "StdLibExtras.h". >+ Also re-sorted includes. >+ >+ * wtf/HashFunctions.h: Add function for "__unsafe_unretained id". >+ * wtf/HashTraits.h: Add traits for "__unsafe_unretained id". >+ >+ * wtf/PlatformMac.cmake: Updated for rename: FoundationSPI.h -> objcSPI.h. >+ >+ * wtf/WeakObjCPtr.h: Use mutable instead of const_cast, and write a version >+ that uses __weak explicitly under ARC. Also moved function declarations from >+ here to objcSPI.h. >+ >+ * wtf/cocoa/AutodrainedPool.cpp: Updated include for rename: FoundationSPI.h -> objcSPI.h. >+ >+ * wtf/spi/cocoa/objcSPI.h: Renamed from FoundationSPI.h and added the >+ additional functions used by WeakObjCPtr.h. Also changed to both include the >+ internal header and the function definitions when compiling with >+ USE(APPLE_INTERNAL_SDK), helping us check that function definitions match. >+ > 2018-08-03 Ben Richards <benton_richards@apple.com> > > We should cache the compiled sandbox profile in a data vault >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index b0fa68f4d9f33b0fabf232da698e612e943d968c..d718cfcb9485810cb75b7799212fdef21a7719b0 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,13 @@ >+2018-08-05 Darin Adler <darin@apple.com> >+ >+ [Cocoa] More tweaks and refactoring to prepare for ARC >+ https://bugs.webkit.org/show_bug.cgi?id=188245 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * bridge/objc/objc_instance.mm: Updated include for rename: FoundationSPI.h -> objcSPI.h. >+ * platform/ios/wak/WebCoreThread.mm: Ditto. >+ > 2018-08-06 Frederic Wang <fwang@igalia.com> > > Make two-arguments versions of scrollBy/scrollTo depend on the one-argument versions >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 4df3209a81b45b6f03d1ae414f04f04e325cc1d4..0ce7785651895094d25c6afda0b958690cff9faf 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,26 @@ >+2018-08-05 Darin Adler <darin@apple.com> >+ >+ [Cocoa] More tweaks and refactoring to prepare for ARC >+ https://bugs.webkit.org/show_bug.cgi?id=188245 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Platform/cocoa/WKCrashReporter.mm: >+ (WebKit::setCrashLogMessage): Refactor into a separate function for clarity. >+ (WebKit::setCrashReportApplicationSpecificInformation): Use a bridging cast. >+ >+ * Shared/mac/PasteboardTypes.mm: >+ (WebKit::PasteboardTypes::forEditing): Use a bridging cast. >+ >+ * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm: >+ (WebKit::convertToNPNNString): Added. Uses CFStringRef rather than NSString so we can >+ manually manage the autoreleasing. >+ (WebKit::initializeKeyboardEvent): Use convertToNPNNString. >+ (WebKit::NetscapePlugin::sendComplexTextInput): Ditto. >+ >+ * WebProcess/Plugins/PDF/PDFPlugin.mm: Use __unsafe_unretained explicitly >+ for a parent pointer. We could consider moving to __weak after switching to ARC. >+ > 2018-08-06 Wenson Hsieh <wenson_hsieh@apple.com> > > [iOS] Caret disappears after resigning and becoming first responder if active focus state is retained >diff --git a/Source/WebKitLegacy/mac/ChangeLog b/Source/WebKitLegacy/mac/ChangeLog >index edb3f3033e1bf32ff6a5f8a7b26c80f664d817ea..96213134aae4335c6fadd95d050f50a2726f30af 100644 >--- a/Source/WebKitLegacy/mac/ChangeLog >+++ b/Source/WebKitLegacy/mac/ChangeLog >@@ -1,3 +1,156 @@ >+2018-08-05 Darin Adler <darin@apple.com> >+ >+ [Cocoa] More tweaks and refactoring to prepare for ARC >+ https://bugs.webkit.org/show_bug.cgi?id=188245 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Carbon/CarbonUtils.m: Updated include for rename: FoundationSPI.h -> objcSPI.h. >+ >+ * Carbon/CarbonWindowFrame.m: >+ (-[CarbonWindowFrame dealloc]): Deleted. It was empty. >+ >+ * DOM/DOM.mm: >+ (-[DOMElement _imageTIFFRepresentation]): Use a bridging cast. >+ (-[DOMNodeFilter finalize]): Deleted. WebKit no longer supports Objective-C >+ garbage collection so this method isn't useful. >+ >+ * DOM/DOMXPath.mm: >+ (-[DOMNativeXPathNSResolver finalize]): Deleted. WebKit no longer supports >+ Objective-C garbage collection so this method isn't useful. >+ >+ * History/WebHistory.mm: >+ (-[WebHistoryPrivate data]): Allocate an NSData instead of casting from a CFData. >+ >+ * Misc/WebElementDictionary.mm: >+ (addLookupKey): Use a bridging cast. >+ (cacheValueForKey): Ditto. >+ (-[WebElementDictionary _fillCache]): Ditto. >+ (-[WebElementDictionary objectForKey:]): Ditto. >+ >+ * Misc/WebKitNSStringExtras.mm: >+ (-[NSString _web_drawAtPoint:font:textColor:]): Use a bridging cast. >+ (-[NSString _web_widthWithFont:]): Ditto. >+ (-[NSString _webkit_stringByTrimmingWhitespace]): Ditto. >+ >+ * Misc/WebLocalizableStrings.mm: >+ (WebLocalizedString): Use a bridging cast. >+ >+ * Misc/WebNSDataExtras.mm: >+ (-[NSString _web_capitalizeRFC822HeaderFieldName]): Use a bridging cast >+ and use CFBridgingRelease instead of calling autorelease directly. >+ (-[NSData _webkit_parseRFC822HeaderFields]): Use NSString methods instead >+ of a mix of CFString and NSString. Also simplified logic a bit, and cut down >+ on the amount of explicit release and autorelease. >+ >+ * Misc/WebNSDictionaryExtras.h: Deleted unused methods. >+ * Misc/WebNSDictionaryExtras.m: >+ (-[NSDictionary _webkit_intForKey:]): Deleted. >+ (-[NSMutableDictionary _webkit_setInt:forKey:]): Deleted. >+ (-[NSMutableDictionary _webkit_setFloat:forKey:]): Deleted. >+ (-[NSMutableDictionary _webkit_setBool:forKey:]): Deleted. >+ (-[NSMutableDictionary _webkit_setLongLong:forKey:]): Deleted. >+ (-[NSMutableDictionary _webkit_setUnsignedLongLong:forKey:]): Deleted. >+ (-[NSMutableDictionary _webkit_setUnsignedInt:forKey:]): Deleted. >+ >+ * Misc/WebStringTruncator.mm: >+ (fontFromNSFont): Use a bridging cast. >+ >+ * Plugins/Hosted/NetscapePluginHostManager.mm: >+ (WebKit::preferredBundleLocalizationName): Use a bridging cast and CFBridgingRelease. >+ >+ * Plugins/Hosted/NetscapePluginInstanceProxy.mm: >+ (WebKit::NetscapePluginInstanceProxy::cleanup): Use a bridging cast. >+ (WebKit::NetscapePluginInstanceProxy::status): Ditto. >+ (WebKit::NetscapePluginInstanceProxy::loadURL): Ditto. >+ (WebKit::NetscapePluginInstanceProxy::demarshalValueFromArray): Ditto. >+ * Plugins/Hosted/ProxyInstance.mm: >+ (WebKit::ProxyInstance::getPropertyNames): Ditto. >+ * Plugins/WebBasePluginPackage.mm: >+ (-[WebBasePluginPackage _objectForInfoDictionaryKey:]): Ditto. >+ * Plugins/WebNetscapePluginEventHandlerCocoa.mm: >+ (WebNetscapePluginEventHandlerCocoa::platformWindow): Ditto. >+ * Plugins/WebNetscapePluginPackage.mm: >+ (-[WebNetscapePluginPackage _initWithPath:]): Ditto. >+ >+ * Plugins/WebNetscapePluginView.mm: >+ (-[WebNetscapePluginView _postURL:target:len:buf:file:notifyData:sendNotification:allowHeaders:]): >+ Use bridging casts and use RetainPtr insteead of an explicit CFRelease. >+ (-[WebNetscapePluginView status:]): Use a bridging cast. >+ (-[WebNetscapePluginView popUpContextMenu:]): Ditto. >+ >+ * Plugins/WebPluginController.mm: >+ (-[WebPluginController _cancelOutstandingChecks]): Use a bridging cast. >+ >+ * Plugins/WebPluginDatabase.mm: >+ (checkCandidate): Use explicit __strong for out argument types. >+ >+ * Plugins/npapi.mm: >+ (pluginViewForInstance): Use a bridging cast. >+ >+ * Storage/WebDatabaseManager.mm: >+ (-[WebDatabaseManager detailsForDatabase:withOrigin:]): Use modern boxing instead of >+ explicit NSNumber and NSDictionary calls. >+ >+ * WebCoreSupport/WebContextMenuClient.mm: >+ (WebContextMenuClient::speak): Remove an unnecessary copy/autorelease pair. >+ >+ * WebCoreSupport/WebEditorClient.mm: >+ (WebEditorClient::handleKeyboardEvent): Added a missing typecast. >+ (WebEditorClient::handleInputMethodKeydown): Ditto. >+ >+ * WebCoreSupport/WebFrameNetworkingContext.mm: >+ (WebFrameNetworkingContext::sourceApplicationAuditData const): Use a bridging cast. >+ >+ * WebCoreSupport/WebSecurityOriginPrivate.h: Forward declare WebSecurityOriginPrivate >+ as a struct rather than an Objective-C class, since that's how it's defined. >+ >+ * WebInspector/WebNodeHighlighter.mm: Added missing includes. >+ >+ * WebView/WebFullScreenController.mm: >+ (-[WebFullScreenController enterFullScreen:]): Use a bridging cast. >+ * WebView/WebHTMLView.mm: >+ (-[WebHTMLView _writeSelectionWithPasteboardTypes:toPasteboard:cachedAttributedString:]): >+ Ditto. >+ (-[WebHTMLView pasteboard:provideDataForType:]): Ditto. >+ >+ * WebView/WebImmediateActionController.mm: >+ (-[WebImmediateActionController performHitTestAtPoint:]): Removed redundant code to >+ go down to the document and then back to the frame. >+ (-[WebImmediateActionController immediateActionRecognizerDidUpdateAnimation:]): Ditto. >+ (-[WebImmediateActionController immediateActionRecognizerDidCancelAnimation:]): Ditto. >+ (-[WebImmediateActionController immediateActionRecognizerDidCompleteAnimation:]): Ditto. >+ >+ * WebView/WebJSPDFDoc.mm: >+ (jsPDFDocInitialize): Removed some unneeded type casting. >+ (jsPDFDocFinalize): Ditto. >+ (jsPDFDocPrint): Use a bridging cast. >+ >+ * WebView/WebPDFView.mm: >+ (_applicationInfoForMIMEType): Use bridging casts. >+ >+ * WebView/WebPreferences.mm: >+ (-[WebPreferences _setIntegerValue:forKey:]): Use boxing and setObject directly >+ instead of methods from WebNSDictionaryExtras. >+ (-[WebPreferences _setUnsignedIntValue:forKey:]): Ditto. >+ (-[WebPreferences _setFloatValue:forKey:]): Ditto. >+ (-[WebPreferences _setBoolValue:forKey:]): Ditto. >+ (-[WebPreferences _setLongLongValue:forKey:]): Ditto. >+ (-[WebPreferences _setUnsignedLongLongValue:forKey:]): Ditto. >+ >+ * WebView/WebView.mm: >+ (-[WebView _removeFromAllWebViewsSet]): Use bridging cast. >+ (-[WebView _addToAllWebViewsSet]): Ditto. >+ (+[WebView closeAllWebViews]): Use a modern for loop instead of NSEnumerator. >+ (-[WebView _windowVisibilityChanged:]): Moved this into the internal category >+ so it can be called from WebViewData methods. >+ >+ * WebView/WebViewData.mm: Added an import so we can call an internal WebView >+ method, _windowVisibilityChanged:. >+ >+ * WebView/WebViewInternal.h: Declared _windowVisibilityChanged: so it can be >+ called from WebViewData methods. >+ > 2018-08-05 Yusuke Suzuki <utatane.tea@gmail.com> > > Add support for microtasks in workers >diff --git a/Source/JavaScriptCore/API/JSValue.mm b/Source/JavaScriptCore/API/JSValue.mm >index 543531ba4b8bf6280e63210f9e76c10afe7ccbb8..417cc9d85fa6ceb8260f8e6953762482d0cfa388 100644 >--- a/Source/JavaScriptCore/API/JSValue.mm >+++ b/Source/JavaScriptCore/API/JSValue.mm >@@ -636,14 +636,14 @@ public: > > private: > JSGlobalContextRef m_context; >- HashMap<JSValueRef, id> m_objectMap; >+ HashMap<JSValueRef, __unsafe_unretained id> m_objectMap; > Vector<Task> m_worklist; > Vector<JSC::Strong<JSC::Unknown>> m_jsValues; > }; > > inline id JSContainerConvertor::convert(JSValueRef value) > { >- HashMap<JSValueRef, id>::iterator iter = m_objectMap.find(value); >+ auto iter = m_objectMap.find(value); > if (iter != m_objectMap.end()) > return iter->value; > >@@ -887,7 +887,7 @@ public: > > private: > JSContext *m_context; >- HashMap<id, JSValueRef> m_objectMap; >+ HashMap<__unsafe_unretained id, JSValueRef> m_objectMap; > Vector<Task> m_worklist; > Vector<JSC::Strong<JSC::Unknown>> m_jsValues; > }; >diff --git a/Source/JavaScriptCore/API/JSWrapperMap.mm b/Source/JavaScriptCore/API/JSWrapperMap.mm >index 91a2129c6bf5aaae1d2a06435f955f91b8a164e1..d5461dd3fba518667f9fdf97f539121c903736ad 100644 >--- a/Source/JavaScriptCore/API/JSWrapperMap.mm >+++ b/Source/JavaScriptCore/API/JSWrapperMap.mm >@@ -408,7 +408,7 @@ static JSC::JSObject* allocateConstructorForCustomClass(JSContext *context, cons > return constructorWithCustomBrand(context, [NSString stringWithFormat:@"%sConstructor", className], cls); > > // For each protocol that the class implements, gather all of the init family methods into a hash table. >- __block HashMap<String, Protocol *> initTable; >+ __block HashMap<String, CFTypeRef> initTable; > Protocol *exportProtocol = getJSExportProtocol(); > for (Class currentClass = cls; currentClass; currentClass = class_getSuperclass(currentClass)) { > forEachProtocolImplementingProtocol(currentClass, exportProtocol, ^(Protocol *protocol, bool&) { >@@ -416,7 +416,7 @@ static JSC::JSObject* allocateConstructorForCustomClass(JSContext *context, cons > const char* name = sel_getName(selector); > if (!isInitFamilyMethod(@(name))) > return; >- initTable.set(name, protocol); >+ initTable.set(name, (__bridge CFTypeRef)protocol); > }); > }); > } >@@ -436,7 +436,7 @@ static JSC::JSObject* allocateConstructorForCustomClass(JSContext *context, cons > > numberOfInitsFound++; > initMethod = selector; >- initProtocol = iter->value; >+ initProtocol = (__bridge Protocol *)iter->value; > types = method_getTypeEncoding(method); > }); > >@@ -565,7 +565,7 @@ @end > > @implementation JSWrapperMap { > NSMutableDictionary *m_classMap; >- std::unique_ptr<JSC::WeakGCMap<id, JSC::JSObject>> m_cachedJSWrappers; >+ std::unique_ptr<JSC::WeakGCMap<__unsafe_unretained id, JSC::JSObject>> m_cachedJSWrappers; > NSMapTable *m_cachedObjCWrappers; > } > >@@ -579,7 +579,7 @@ - (instancetype)initWithGlobalContextRef:(JSGlobalContextRef)context > NSPointerFunctionsOptions valueOptions = NSPointerFunctionsWeakMemory | NSPointerFunctionsObjectPersonality; > m_cachedObjCWrappers = [[NSMapTable alloc] initWithKeyOptions:keyOptions valueOptions:valueOptions capacity:0]; > >- m_cachedJSWrappers = std::make_unique<JSC::WeakGCMap<id, JSC::JSObject>>(toJS(context)->vm()); >+ m_cachedJSWrappers = std::make_unique<JSC::WeakGCMap<__unsafe_unretained id, JSC::JSObject>>(toJS(context)->vm()); > > ASSERT(!toJSGlobalObject(context)->wrapperMap()); > toJSGlobalObject(context)->setWrapperMap(self); >diff --git a/Source/JavaScriptCore/heap/Heap.cpp b/Source/JavaScriptCore/heap/Heap.cpp >index ea3a0fc4a1043f625baab8bfa3f70f5d6ce8d319..c782fcbb7051dbd65b13dedfa526626b67c73c5f 100644 >--- a/Source/JavaScriptCore/heap/Heap.cpp >+++ b/Source/JavaScriptCore/heap/Heap.cpp >@@ -90,7 +90,7 @@ > #endif > > #if USE(FOUNDATION) >-#include <wtf/spi/cocoa/FoundationSPI.h> >+#include <wtf/spi/cocoa/objcSPI.h> > #endif > > #if USE(GLIB) >diff --git a/Source/WTF/WTF.xcodeproj/project.pbxproj b/Source/WTF/WTF.xcodeproj/project.pbxproj >index e9b59ef65a6c169e8c89d503d12c021376ed9dcd..5f639ea3057e62f895db3e232d23b371aa69ae7e 100644 >--- a/Source/WTF/WTF.xcodeproj/project.pbxproj >+++ b/Source/WTF/WTF.xcodeproj/project.pbxproj >@@ -411,7 +411,7 @@ > 93934BD218A1E8C300D0D6A1 /* StringViewCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = StringViewCocoa.mm; sourceTree = "<group>"; }; > 93934BD418A1F16900D0D6A1 /* StringViewCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StringViewCF.cpp; sourceTree = "<group>"; }; > 93AC91A718942FC400244939 /* LChar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LChar.h; sourceTree = "<group>"; }; >- 93D191CF20CAECE800C51B8E /* FoundationSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FoundationSPI.h; sourceTree = "<group>"; }; >+ 93D191CF20CAECE800C51B8E /* objcSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = objcSPI.h; sourceTree = "<group>"; }; > 93DDE9311CDC052D00FD3491 /* dyldSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dyldSPI.h; sourceTree = "<group>"; }; > 93F1993D19D7958D00C2390B /* StringView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StringView.cpp; sourceTree = "<group>"; }; > 974CFC8D16A4F327006D5404 /* WeakPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakPtr.h; sourceTree = "<group>"; }; >@@ -1276,8 +1276,8 @@ > isa = PBXGroup; > children = ( > 9384B73E20DEA284005B73B2 /* CFXPCBridgeSPI.h */, >- 93D191CF20CAECE800C51B8E /* FoundationSPI.h */, > CE46516D19DB1FB4003ECA05 /* NSMapTableSPI.h */, >+ 93D191CF20CAECE800C51B8E /* objcSPI.h */, > A5098B011C16A4F900087797 /* SecuritySPI.h */, > ); > path = cocoa; >diff --git a/Source/WTF/wtf/BlockPtr.h b/Source/WTF/wtf/BlockPtr.h >index ac3e12c36b7c2fce16918c461e2a835b34b33bef..a0111958782c90b199692e8b8c40bd72d1601095 100644 >--- a/Source/WTF/wtf/BlockPtr.h >+++ b/Source/WTF/wtf/BlockPtr.h >@@ -26,6 +26,10 @@ > #pragma once > > #include <Block.h> >+#include <utility> >+#include <wtf/Assertions.h> >+#include <wtf/StdLibExtras.h> >+ > #if CPU(ARM64E) > #include <WebKitAdditions/BlockQualifiers.h> > #else >@@ -33,8 +37,6 @@ > #define WTF_DISPOSE_FUNCTION_POINTER_QUALIFIER > #define WTF_INVOKE_FUNCTION_POINTER_QUALIFIER > #endif >-#include <utility> >-#include <wtf/Assertions.h> > > namespace WTF { > >diff --git a/Source/WTF/wtf/HashFunctions.h b/Source/WTF/wtf/HashFunctions.h >index 9db913a100542988a12af8a02de2796ad0ea304e..12b5443b0ba28fb7caa205d0e4597de3e3bb241f 100644 >--- a/Source/WTF/wtf/HashFunctions.h >+++ b/Source/WTF/wtf/HashFunctions.h >@@ -243,6 +243,10 @@ namespace WTF { > > template<typename P, typename Deleter> struct DefaultHash<std::unique_ptr<P, Deleter>> { typedef PtrHash<std::unique_ptr<P, Deleter>> Hash; }; > >+#ifdef __OBJC__ >+ template<> struct DefaultHash<__unsafe_unretained id> { using Hash = PtrHash<__unsafe_unretained id>; }; >+#endif >+ > // make IntPairHash the default hash function for pairs of (at most) 32-bit integers. > > template<> struct DefaultHash<std::pair<short, short>> { typedef IntPairHash<short, short> Hash; }; >diff --git a/Source/WTF/wtf/HashTraits.h b/Source/WTF/wtf/HashTraits.h >index bcd8d7b0028c04e40854a5ae4a7a4130a440c20f..ebf390584af3b374cbbfb8b33f6152b9dbf269d7 100644 >--- a/Source/WTF/wtf/HashTraits.h >+++ b/Source/WTF/wtf/HashTraits.h >@@ -29,6 +29,10 @@ > #include <wtf/Optional.h> > #include <wtf/StdLibExtras.h> > >+#ifdef __OBJC__ >+#include <CoreFoundation/CoreFoundation.h> >+#endif >+ > namespace WTF { > > template<bool isInteger, typename T> struct GenericHashTraitsBase; >@@ -115,6 +119,16 @@ template<typename P> struct HashTraits<P*> : GenericHashTraits<P*> { > static bool isDeletedValue(P* value) { return value == reinterpret_cast<P*>(-1); } > }; > >+#ifdef __OBJC__ >+ >+template<> struct HashTraits<__unsafe_unretained id> : GenericHashTraits<__unsafe_unretained id> { >+ static const bool emptyValueIsZero = true; >+ static void constructDeletedValue(__unsafe_unretained id& slot) { slot = (__bridge __unsafe_unretained id)reinterpret_cast<CFTypeRef>(-1); } >+ static bool isDeletedValue(__unsafe_unretained id value) { return (__bridge CFTypeRef)value == reinterpret_cast<CFTypeRef>(-1); } >+}; >+ >+#endif >+ > template<typename T> struct SimpleClassHashTraits : GenericHashTraits<T> { > static const bool emptyValueIsZero = true; > static void constructDeletedValue(T& slot) { new (NotNull, std::addressof(slot)) T(HashTableDeletedValue); } >diff --git a/Source/WTF/wtf/PlatformMac.cmake b/Source/WTF/wtf/PlatformMac.cmake >index f9b11448cf25c332f103755e9d3c47fc0d965cde..7837236fcd6d3ada7f1e1fb137c73765a75e74cf 100644 >--- a/Source/WTF/wtf/PlatformMac.cmake >+++ b/Source/WTF/wtf/PlatformMac.cmake >@@ -21,9 +21,9 @@ list(APPEND WTF_PUBLIC_HEADERS > spi/cf/CFBundleSPI.h > spi/cf/CFStringSPI.h > >- spi/cocoa/FoundationSPI.h > spi/cocoa/NSMapTableSPI.h > spi/cocoa/SecuritySPI.h >+ spi/cocoa/objcSPI.h > > spi/darwin/SandboxSPI.h > spi/darwin/XPCSPI.h >diff --git a/Source/WTF/wtf/WeakObjCPtr.h b/Source/WTF/wtf/WeakObjCPtr.h >index f910830b85a18d9f85ecaf1ee35b197255f69ecc..0e7a4ecf4531d05797dee5ceab3539786c719abf 100644 >--- a/Source/WTF/wtf/WeakObjCPtr.h >+++ b/Source/WTF/wtf/WeakObjCPtr.h >@@ -28,38 +28,30 @@ > #include <objc/runtime.h> > #include <type_traits> > #include <wtf/RetainPtr.h> >- >-#if __has_include(<objc/objc-internal.h>) >-#include <objc/objc-internal.h> >-#else >-extern "C" { >-id objc_loadWeakRetained(id*); >-id objc_initWeak(id*, id); >-void objc_destroyWeak(id*); >-void objc_copyWeak(id*, id*); >-void objc_moveWeak(id*, id*); >-} >-#endif >+#include <wtf/spi/cocoa/objcSPI.h> > > namespace WTF { > > template<typename T> class WeakObjCPtr { > public: >- typedef typename std::remove_pointer<T>::type ValueType; >+ using ValueType = typename std::remove_pointer<T>::type; > >- WeakObjCPtr() >- : m_weakReference(nullptr) >- { >- } >+ WeakObjCPtr() = default; > > WeakObjCPtr(ValueType *ptr) >+#if __has_feature(objc_arc) >+ : m_weakReference(ptr) >+#endif > { >+#if !__has_feature(objc_arc) > objc_initWeak(&m_weakReference, ptr); >+#endif > } > >+#if !__has_feature(objc_arc) > WeakObjCPtr(const WeakObjCPtr& other) > { >- objc_copyWeak(&m_weakReference, const_cast<id*>(&other.m_weakReference)); >+ objc_copyWeak(&m_weakReference, &other.m_weakReference); > } > > WeakObjCPtr(WeakObjCPtr&& other) >@@ -71,10 +63,15 @@ public: > { > objc_destroyWeak(&m_weakReference); > } >+#endif > > WeakObjCPtr& operator=(ValueType *ptr) > { >+#if __has_feature(objc_arc) >+ m_weakReference = ptr; >+#else > objc_storeWeak(&m_weakReference, ptr); >+#endif > > return *this; > } >@@ -86,18 +83,31 @@ public: > > RetainPtr<ValueType> get() const > { >- return adoptNS(objc_loadWeakRetained(const_cast<id*>(&m_weakReference))); >+#if __has_feature(objc_arc) >+ return static_cast<ValueType *>(m_weakReference); >+#else >+ return adoptNS(objc_loadWeakRetained(&m_weakReference)); >+#endif > } > > ValueType *getAutoreleased() const > { >- return static_cast<ValueType *>(objc_loadWeak(const_cast<id*>(&m_weakReference))); >+#if __has_feature(objc_arc) >+ return static_cast<ValueType *>(m_weakReference); >+#else >+ return static_cast<ValueType *>(objc_loadWeak(&m_weakReference)); >+#endif >+ > } > > explicit operator ValueType *() const { return getAutoreleased(); } > > private: >- id m_weakReference; >+#if __has_feature(objc_arc) >+ mutable __weak id m_weakReference { nullptr }; >+#else >+ mutable id m_weakReference { nullptr }; >+#endif > }; > > } // namespace WTF >diff --git a/Source/WTF/wtf/cocoa/AutodrainedPool.cpp b/Source/WTF/wtf/cocoa/AutodrainedPool.cpp >index b0d7c821f327c2d1284a62080564671efb17b087..6c781a1bb2db48de8bb4e052d65e80499ff3f302 100644 >--- a/Source/WTF/wtf/cocoa/AutodrainedPool.cpp >+++ b/Source/WTF/wtf/cocoa/AutodrainedPool.cpp >@@ -29,7 +29,7 @@ > #import "config.h" > #import "AutodrainedPool.h" > >-#import <wtf/spi/cocoa/FoundationSPI.h> >+#import <wtf/spi/cocoa/objcSPI.h> > > namespace WTF { > >diff --git a/Source/WTF/wtf/spi/cocoa/FoundationSPI.h b/Source/WTF/wtf/spi/cocoa/FoundationSPI.h >deleted file mode 100644 >index 2691044db3c11aa256607ff9c47072a1c70ee431..0000000000000000000000000000000000000000 >--- a/Source/WTF/wtf/spi/cocoa/FoundationSPI.h >+++ /dev/null >@@ -1,41 +0,0 @@ >-/* >- * Copyright (C) 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 >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#pragma once >- >-#if USE(APPLE_INTERNAL_SDK) >- >-#include <objc/objc-internal.h> >- >-#else >- >-WTF_EXTERN_C_BEGIN >- >-void* objc_autoreleasePoolPush(void); >-void objc_autoreleasePoolPop(void* context); >- >-WTF_EXTERN_C_END >- >-#endif >diff --git a/Source/WTF/wtf/spi/cocoa/objcSPI.h b/Source/WTF/wtf/spi/cocoa/objcSPI.h >new file mode 100644 >index 0000000000000000000000000000000000000000..a9e89de076f05ac6419955172b53b7ef2f4424a1 >--- /dev/null >+++ b/Source/WTF/wtf/spi/cocoa/objcSPI.h >@@ -0,0 +1,47 @@ >+/* >+ * Copyright (C) 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 >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#if USE(APPLE_INTERNAL_SDK) >+ >+#include <objc/objc-internal.h> >+ >+#endif >+ >+WTF_EXTERN_C_BEGIN >+ >+void* objc_autoreleasePoolPush(void); >+void objc_autoreleasePoolPop(void* context); >+ >+#ifdef __OBJC__ >+id objc_loadWeakRetained(id*); >+id objc_initWeak(id*, id); >+void objc_destroyWeak(id*); >+void objc_copyWeak(id*, id*); >+void objc_moveWeak(id*, id*); >+#endif >+ >+WTF_EXTERN_C_END >diff --git a/Source/WebCore/bridge/objc/objc_instance.mm b/Source/WebCore/bridge/objc/objc_instance.mm >index e8b78eb65b36488f65d7f0148be3e51d41c4c993..b81068a4dde0513a1c0f43fd1a4a9572df8c82cf 100644 >--- a/Source/WebCore/bridge/objc/objc_instance.mm >+++ b/Source/WebCore/bridge/objc/objc_instance.mm >@@ -40,7 +40,7 @@ > #import <wtf/MainThread.h> > #import <wtf/NeverDestroyed.h> > #import <wtf/ThreadSpecific.h> >-#import <wtf/spi/cocoa/FoundationSPI.h> >+#import <wtf/spi/cocoa/objcSPI.h> > > #ifdef NDEBUG > #define OBJC_LOG(formatAndArgs...) ((void)0) >diff --git a/Source/WebCore/platform/ios/wak/WebCoreThread.mm b/Source/WebCore/platform/ios/wak/WebCoreThread.mm >index 43bb32a930a2145921f05c2c7fc2202f81934348..1faf8d5d503e1e18e2459e4424dea96b5530bdb8 100644 >--- a/Source/WebCore/platform/ios/wak/WebCoreThread.mm >+++ b/Source/WebCore/platform/ios/wak/WebCoreThread.mm >@@ -48,7 +48,7 @@ > #import <wtf/RecursiveLockAdapter.h> > #import <wtf/RunLoop.h> > #import <wtf/Threading.h> >-#import <wtf/spi/cocoa/FoundationSPI.h> >+#import <wtf/spi/cocoa/objcSPI.h> > #import <wtf/text/AtomicString.h> > > #define LOG_MESSAGES 0 >diff --git a/Source/WebKit/Platform/cocoa/WKCrashReporter.mm b/Source/WebKit/Platform/cocoa/WKCrashReporter.mm >index a4e6dee705f8e4edd7b54b74ca1652142f94744f..923d3ba94c889303d9c3338502fbd68997a1c62f 100644 >--- a/Source/WebKit/Platform/cocoa/WKCrashReporter.mm >+++ b/Source/WebKit/Platform/cocoa/WKCrashReporter.mm >@@ -26,6 +26,7 @@ > #import "config.h" > #import "WKCrashReporter.h" > >+#import <cstdlib> > #import "CrashReporterClientSPI.h" > > // Avoid having to link with libCrashReporterClient.a >@@ -36,19 +37,21 @@ __attribute__((section("__DATA," CRASHREPORTER_ANNOTATIONS_SECTION))) > > namespace WebKit { > >-void setCrashReportApplicationSpecificInformation(CFStringRef infoString) >+static void setCrashLogMessage(const char* message) > { >- if (char* oldMessage = const_cast<char*>(CRGetCrashLogMessage())) >- free(oldMessage); >+ // We have to copy the string because CRSetCrashLogMessage doesn't. >+ char* copiedMessage = message ? strdup(message) : nullptr; >+ >+ CRSetCrashLogMessage(copiedMessage); > >- if (!infoString) { >- CRSetCrashLogMessage(nullptr); >- return; >- } >+ // Delete the message from last time, so we don't keep leaking messages. >+ static char* previousCopiedCrashLogMessage; >+ std::free(std::exchange(previousCopiedCrashLogMessage, copiedMessage)); >+} > >- // We have to copy the string, because CRSetCrashLogMessage doesn't copy the data. >- char* lastInfoChars = strdup([(NSString *)infoString UTF8String]); >- CRSetCrashLogMessage(lastInfoChars); >+void setCrashReportApplicationSpecificInformation(CFStringRef infoString) >+{ >+ setCrashLogMessage([(__bridge NSString *)infoString UTF8String]); > } > > } >diff --git a/Source/WebKit/Shared/mac/PasteboardTypes.mm b/Source/WebKit/Shared/mac/PasteboardTypes.mm >index d47b12d0b67d86175402bd58214c764aabda243b..712f9d785a34223a2fa541baf78e20b7a30da81f 100644 >--- a/Source/WebKit/Shared/mac/PasteboardTypes.mm >+++ b/Source/WebKit/Shared/mac/PasteboardTypes.mm >@@ -47,7 +47,7 @@ static inline NSArray *retain(NSArray *array) > NSArray* PasteboardTypes::forEditing() > { > static NSArray *types = retain([NSArray arrayWithObjects:WebArchivePboardType, WebCore::legacyHTMLPasteboardType(), WebCore::legacyFilenamesPasteboardType(), WebCore::legacyTIFFPasteboardType(), WebCore::legacyPDFPasteboardType(), >- WebCore::legacyURLPasteboardType(), WebCore::legacyRTFDPasteboardType(), WebCore::legacyRTFPasteboardType(), WebCore::legacyStringPasteboardType(), WebCore::legacyColorPasteboardType(), kUTTypePNG, nil]); >+ WebCore::legacyURLPasteboardType(), WebCore::legacyRTFDPasteboardType(), WebCore::legacyRTFPasteboardType(), WebCore::legacyStringPasteboardType(), WebCore::legacyColorPasteboardType(), (__bridge NSString *)kUTTypePNG, nil]); > return types; > } > >diff --git a/Source/WebKit/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm b/Source/WebKit/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm >index 8bbed6bedc9517ea7f7e5ab4f7b9092f577bc1c2..55590c1d38c393bdcd4b49e9c099fc3b23d8d104 100644 >--- a/Source/WebKit/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm >+++ b/Source/WebKit/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm >@@ -741,6 +741,12 @@ static bool isFlagsChangedEvent(const WebKeyboardEvent& keyboardEvent) > return false; > } > >+static NPNSString *convertToNPNNString(const String& string) >+{ >+ CFTypeRef releasedString = string.createCFString().autorelease(); >+ return static_cast<NPNSString*>(const_cast<void*>(releasedString)); >+} >+ > static NPCocoaEvent initializeKeyboardEvent(const WebKeyboardEvent& keyboardEvent) > { > NPCocoaEventType eventType; >@@ -763,8 +769,8 @@ static NPCocoaEvent initializeKeyboardEvent(const WebKeyboardEvent& keyboardEven > > NPCocoaEvent event = initializeEvent(eventType); > event.data.key.modifierFlags = modifierFlags(keyboardEvent); >- event.data.key.characters = reinterpret_cast<NPNSString*>(static_cast<NSString*>(keyboardEvent.text())); >- event.data.key.charactersIgnoringModifiers = reinterpret_cast<NPNSString*>(static_cast<NSString*>(keyboardEvent.unmodifiedText())); >+ event.data.key.characters = convertToNPNNString(keyboardEvent.text()); >+ event.data.key.charactersIgnoringModifiers = convertToNPNNString(keyboardEvent.unmodifiedText()); > event.data.key.isARepeat = keyboardEvent.isAutoRepeat(); > event.data.key.keyCode = keyboardEvent.nativeVirtualKeyCode(); > >@@ -1020,7 +1026,7 @@ void NetscapePlugin::sendComplexTextInput(const String& textInput) > switch (m_eventModel) { > case NPEventModelCocoa: { > NPCocoaEvent event = initializeEvent(NPCocoaEventTextInput); >- event.data.text.text = reinterpret_cast<NPNSString*>(static_cast<NSString*>(textInput)); >+ event.data.text.text = convertToNPNNString(textInput); > NPP_HandleEvent(&event); > break; > } >diff --git a/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm b/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm >index 3c895bcb1c3f98956fce1b16b5a04a5a2fa68a71..a2eb402d0748174a866c4acc382ceefb43f320e7 100644 >--- a/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm >+++ b/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm >@@ -127,7 +127,7 @@ static const int defaultScrollMagnitudeThresholdForPageFlip = 20; > > @interface WKPDFPluginAccessibilityObject : NSObject { > PDFLayerController *_pdfLayerController; >- NSObject *_parent; >+ __unsafe_unretained NSObject *_parent; > WebKit::PDFPlugin* _pdfPlugin; > } > >diff --git a/Source/WebKitLegacy/mac/Carbon/CarbonUtils.m b/Source/WebKitLegacy/mac/Carbon/CarbonUtils.m >index ff14b3c0ff07881d0ba4ce46fae02173b8ac3c03..b795e9b42a6e71485dd177ccd9ddc73a4947e0df 100644 >--- a/Source/WebKitLegacy/mac/Carbon/CarbonUtils.m >+++ b/Source/WebKitLegacy/mac/Carbon/CarbonUtils.m >@@ -29,7 +29,7 @@ > #ifndef __LP64__ > > #include "CarbonUtils.h" >-#import <wtf/spi/cocoa/FoundationSPI.h> >+#import <wtf/spi/cocoa/objcSPI.h> > > extern CGImageRef _NSCreateImageRef( unsigned char *const bitmapData[5], int pixelsWide, int pixelsHigh, int bitsPerSample, int samplesPerPixel, int bitsPerPixel, int bytesPerRow, BOOL isPlanar, BOOL hasAlpha, NSString *colorSpaceName, CGColorSpaceRef customColorSpace, id sourceObj); > >diff --git a/Source/WebKitLegacy/mac/Carbon/CarbonWindowFrame.m b/Source/WebKitLegacy/mac/Carbon/CarbonWindowFrame.m >index ac2a5f7c44119251b9c89c0ab1cb6a7a7cbf1fe6..e926eb6c21e0fa88f28dc4a061c390225325eb97 100644 >--- a/Source/WebKitLegacy/mac/Carbon/CarbonWindowFrame.m >+++ b/Source/WebKitLegacy/mac/Carbon/CarbonWindowFrame.m >@@ -128,15 +128,6 @@ - (id)initWithFrame:(NSRect)inFrameRect styleMask:(unsigned int)inStyleMask owne > } > > >-// Deallocate. >-- (void)dealloc { >- >- // Simple. >- [super dealloc]; >- >-} >- >- > // Sink a method invocation. > - (void)_setFrameNeedsDisplay:(BOOL)needsDisplay { > >diff --git a/Source/WebKitLegacy/mac/DOM/DOM.mm b/Source/WebKitLegacy/mac/DOM/DOM.mm >index 83d56d0448655f76a8c76b9b93ceeefb8a7dd81a..8ebb8a0daf6345f21903d6fecb24d8f14e06c2a1 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOM.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOM.mm >@@ -694,7 +694,7 @@ - (NSData *)_imageTIFFRepresentation > auto* cachedImage = downcast<RenderImage>(*renderer).cachedImage(); > if (!cachedImage || cachedImage->errorOccurred()) > return nil; >- return (NSData *)cachedImage->imageForRenderer(renderer)->tiffRepresentation(); >+ return (__bridge NSData *)cachedImage->imageForRenderer(renderer)->tiffRepresentation(); > } > > #endif >@@ -843,13 +843,6 @@ - (void)dealloc > [super dealloc]; > } > >-- (void)finalize >-{ >- if (_internal) >- reinterpret_cast<WebCore::NodeFilter*>(_internal)->deref(); >- [super finalize]; >-} >- > - (short)acceptNode:(DOMNode *)node > { > if (!node) >diff --git a/Source/WebKitLegacy/mac/DOM/DOMXPath.mm b/Source/WebKitLegacy/mac/DOM/DOMXPath.mm >index 53dc22de1ea99b018716d5a7d782664614f24002..cda837ac7d9229dca4bda63f368c3dfb949118d3 100644 >--- a/Source/WebKitLegacy/mac/DOM/DOMXPath.mm >+++ b/Source/WebKitLegacy/mac/DOM/DOMXPath.mm >@@ -45,13 +45,6 @@ - (void)dealloc > [super dealloc]; > } > >-- (void)finalize >-{ >- if (_internal) >- IMPL->deref(); >- [super finalize]; >-} >- > - (NSString *)lookupNamespaceURI:(NSString *)prefix > { > return IMPL->lookupNamespaceURI(prefix); >diff --git a/Source/WebKitLegacy/mac/History/WebHistory.mm b/Source/WebKitLegacy/mac/History/WebHistory.mm >index 13832e1a527feb0699bf0580ca8a7f99da52aeb8..90496bbb993642996bf5a2456df8688df865607b 100644 >--- a/Source/WebKitLegacy/mac/History/WebHistory.mm >+++ b/Source/WebKitLegacy/mac/History/WebHistory.mm >@@ -644,10 +644,10 @@ - (BOOL)loadFromURL:(NSURL *)URL collectDiscardedItemsInto:(NSMutableArray *)dis > - (NSData *)data > { > if (_entriesByDate->isEmpty()) { >- static NSData *emptyHistoryData = (NSData *)CFDataCreate(0, 0, 0); >+ static NSData *emptyHistoryData = [[NSData alloc] init]; > return emptyHistoryData; > } >- >+ > // Ignores the date and item count limits; these are respected when loading instead of when saving, so > // that clients can learn of discarded items by listening to WebHistoryItemsDiscardedWhileLoadingNotification. > WebHistoryWriter writer(_entriesByDate.get()); >diff --git a/Source/WebKitLegacy/mac/Misc/WebElementDictionary.mm b/Source/WebKitLegacy/mac/Misc/WebElementDictionary.mm >index c3cb9aa5041a8025665cc7e7e02e26feea8fbf5c..b7f7b2824a9dc66788f0283aab971199f60a2397 100644 >--- a/Source/WebKitLegacy/mac/Misc/WebElementDictionary.mm >+++ b/Source/WebKitLegacy/mac/Misc/WebElementDictionary.mm >@@ -53,13 +53,13 @@ static CFMutableDictionaryRef lookupTable = NULL; > > static void addLookupKey(NSString *key, SEL selector) > { >- CFDictionaryAddValue(lookupTable, key, selector); >+ CFDictionaryAddValue(lookupTable, (__bridge CFStringRef)key, selector); > } > > static void cacheValueForKey(const void *key, const void *value, void *self) > { > // calling objectForKey will cache the value in our _cache dictionary >- [(WebElementDictionary *)self objectForKey:(NSString *)key]; >+ [(__bridge WebElementDictionary *)self objectForKey:(__bridge NSString *)key]; > } > > @implementation WebElementDictionary >@@ -124,7 +124,7 @@ - (void)dealloc > > - (void)_fillCache > { >- CFDictionaryApplyFunction(lookupTable, cacheValueForKey, self); >+ CFDictionaryApplyFunction(lookupTable, cacheValueForKey, (__bridge void*)self); > _cacheComplete = YES; > } > >@@ -148,7 +148,7 @@ - (id)objectForKey:(id)key > if (value || _cacheComplete || [_nilValues containsObject:key]) > return value; > >- SEL selector = static_cast<SEL>(const_cast<void*>(CFDictionaryGetValue(lookupTable, key))); >+ SEL selector = static_cast<SEL>(const_cast<void*>(CFDictionaryGetValue(lookupTable, (__bridge CFTypeRef)key))); > if (!selector) > return nil; > value = [self performSelector:selector]; >diff --git a/Source/WebKitLegacy/mac/Misc/WebKitNSStringExtras.mm b/Source/WebKitLegacy/mac/Misc/WebKitNSStringExtras.mm >index ac436617c28e87782cfc1ac1f0c68798b051e22a..7f99502f36b74923f311e0061aebe14d76646cce 100644 >--- a/Source/WebKitLegacy/mac/Misc/WebKitNSStringExtras.mm >+++ b/Source/WebKitLegacy/mac/Misc/WebKitNSStringExtras.mm >@@ -68,7 +68,7 @@ - (void)_web_drawAtPoint:(NSPoint)point font:(NSFont *)font textColor:(NSColor * > [self getCharacters:buffer.data()]; > > if (canUseFastRenderer(buffer.data(), length)) { >- FontCascade webCoreFont(FontPlatformData(reinterpret_cast<CTFontRef>(font), [font pointSize])); >+ FontCascade webCoreFont(FontPlatformData((__bridge CTFontRef)font, [font pointSize])); > TextRun run(StringView(buffer.data(), length)); > > // The following is a half-assed attempt to match AppKit's rounding rules for drawAtPoint. >@@ -111,7 +111,7 @@ - (float)_web_widthWithFont:(NSFont *)font > [self getCharacters:buffer.data()]; > > if (canUseFastRenderer(buffer.data(), length)) { >- FontCascade webCoreFont(FontPlatformData(reinterpret_cast<CTFontRef>(font), [font pointSize])); >+ FontCascade webCoreFont(FontPlatformData((__bridge CTFontRef)font, [font pointSize])); > TextRun run(StringView(buffer.data(), length)); > return webCoreFont.width(run); > } >@@ -162,7 +162,7 @@ -(NSString *)_webkit_filenameByFixingIllegalCharacters > -(NSString *)_webkit_stringByTrimmingWhitespace > { > NSMutableString *trimmed = [[self mutableCopy] autorelease]; >- CFStringTrimWhitespace((CFMutableStringRef)trimmed); >+ CFStringTrimWhitespace((__bridge CFMutableStringRef)trimmed); > return trimmed; > } > >diff --git a/Source/WebKitLegacy/mac/Misc/WebLocalizableStrings.mm b/Source/WebKitLegacy/mac/Misc/WebLocalizableStrings.mm >index 2a8a837619fa68483e5f03d1f5dba7dfa6ac4cd0..2c480dbaf0eb20bbe9b5d5db84ff40a961c318c9 100644 >--- a/Source/WebKitLegacy/mac/Misc/WebLocalizableStrings.mm >+++ b/Source/WebKitLegacy/mac/Misc/WebLocalizableStrings.mm >@@ -62,7 +62,7 @@ NSString *WebLocalizedString(WebLocalizableStringsBundle *stringsBundle, const c > } > NSString *notFound = @"localized string not found"; > CFStringRef keyString = CFStringCreateWithCStringNoCopy(NULL, key, kCFStringEncodingUTF8, kCFAllocatorNull); >- NSString *result = [bundle localizedStringForKey:(NSString *)keyString value:notFound table:nil]; >+ NSString *result = [bundle localizedStringForKey:(__bridge NSString *)keyString value:notFound table:nil]; > CFRelease(keyString); > ASSERT_WITH_MESSAGE(result != notFound, "could not find localizable string %s in bundle", key); > return result; >diff --git a/Source/WebKitLegacy/mac/Misc/WebNSDataExtras.mm b/Source/WebKitLegacy/mac/Misc/WebNSDataExtras.mm >index b01ffb7e0cfd260507549a525abddd9952c82d76..c694e5209c4f90cd82f78888fe86425a8ffe4889 100644 >--- a/Source/WebKitLegacy/mac/Misc/WebNSDataExtras.mm >+++ b/Source/WebKitLegacy/mac/Misc/WebNSDataExtras.mm >@@ -36,7 +36,7 @@ @implementation NSString (WebNSDataExtrasInternal) > > - (NSString *)_web_capitalizeRFC822HeaderFieldName > { >- CFStringRef name = (CFStringRef)self; >+ CFStringRef name = (__bridge CFStringRef)self; > NSString *result = nil; > > CFIndex len = CFStringGetLength(name); >@@ -82,13 +82,13 @@ - (NSString *)_web_capitalizeRFC822HeaderFieldName > } > if (somethingChanged) { > if (useUniCharPtr) >- result = (NSString *)CFStringCreateWithCharactersNoCopy(NULL, uniCharPtr, len, NULL); >+ result = CFBridgingRelease(CFStringCreateWithCharactersNoCopy(kCFAllocatorDefault, uniCharPtr, len, nullptr)); > else >- result = (NSString *)CFStringCreateWithCStringNoCopy(NULL, charPtr, kCFStringEncodingISOLatin1, NULL); >+ result = CFBridgingRelease(CFStringCreateWithCStringNoCopy(kCFAllocatorDefault, charPtr, kCFStringEncodingISOLatin1, nullptr)); > } else >- result = [self retain]; >+ result = self; > >- return [result autorelease]; >+ return result; > } > > @end >@@ -311,44 +311,33 @@ - (NSMutableDictionary *)_webkit_parseRFC822HeaderFields > } > // Merge the continuation of the previous header > NSString *currentValue = [headerFields objectForKey:lastKey]; >- NSString *newValue = (NSString *)CFStringCreateWithBytes(NULL, line, lineLength, kCFStringEncodingISOLatin1, FALSE); >+ NSString *newValue = [[NSString alloc] initWithBytes:line length:lineLength encoding:NSISOLatin1StringEncoding]; > ASSERT(currentValue); > ASSERT(newValue); >- NSString *mergedValue = [[NSString alloc] initWithFormat:@"%@%@", currentValue, newValue]; >- [headerFields setObject:(NSString *)mergedValue forKey:lastKey]; >+ [headerFields setObject:[currentValue stringByAppendingString:newValue] forKey:lastKey]; > [newValue release]; >- [mergedValue release]; >- // Note: currentValue is autoreleased > } else { > // Brand new header >- const UInt8 *colon; >+ const UInt8* colon; > for (colon = line; *colon != ':' && colon != eol; colon++) { } > if (colon == eol) { > // malformed header; ignore it and continue > continue; > } >- lastKey = (NSString *)CFStringCreateWithBytes(NULL, line, colon - line, kCFStringEncodingISOLatin1, FALSE); >+ lastKey = [[NSString alloc] initWithBytes:line length:colon - line encoding:NSISOLatin1StringEncoding]; > [lastKey autorelease]; >- NSString *value = [lastKey _web_capitalizeRFC822HeaderFieldName]; >- lastKey = value; >+ lastKey = [lastKey _web_capitalizeRFC822HeaderFieldName]; > for (colon++; colon != eol; colon++) { > if (*colon != ' ' && *colon != '\t') > break; > } >- if (colon == eol) { >- value = [[NSString alloc] initWithString:@""]; >- [value autorelease]; >- } else { >- value = (NSString *)CFStringCreateWithBytes(NULL, colon, eol-colon, kCFStringEncodingISOLatin1, FALSE); >+ NSString *value = [[NSString alloc] initWithBytes:colon length:eol - colon encoding:NSISOLatin1StringEncoding]; >+ if (NSString *oldValue = [headerFields objectForKey:lastKey]) { > [value autorelease]; >+ value = [[NSString alloc] initWithFormat:@"%@, %@", oldValue, value]; > } >- NSString *oldValue = [headerFields objectForKey:lastKey]; >- if (oldValue) { >- NSString *newValue = [[NSString alloc] initWithFormat:@"%@, %@", oldValue, value]; >- value = newValue; >- [newValue autorelease]; >- } >- [headerFields setObject:(NSString *)value forKey:lastKey]; >+ [headerFields setObject:value forKey:lastKey]; >+ [value release]; > } > } > >diff --git a/Source/WebKitLegacy/mac/Misc/WebNSDictionaryExtras.h b/Source/WebKitLegacy/mac/Misc/WebNSDictionaryExtras.h >index 05732024a87ad8f649cb81b37469abfe24c794fd..b4a4cec66f38198feaf9a7f0ebe09dd2b511ebbb 100644 >--- a/Source/WebKitLegacy/mac/Misc/WebNSDictionaryExtras.h >+++ b/Source/WebKitLegacy/mac/Misc/WebNSDictionaryExtras.h >@@ -29,20 +29,12 @@ > #import <Foundation/Foundation.h> > > @interface NSDictionary (WebNSDictionaryExtras) >+ > - (BOOL)_webkit_boolForKey:(id)key; >-- (int)_webkit_intForKey:(id)key; > - (NSString *)_webkit_stringForKey:(id)key; // Returns nil if the value is not an NSString. > - (NSArray *)_webkit_arrayForKey:(id)key; // Returns nil if the value is not an NSArray. > > // Searches for the full MIME type, then the prefix (e.g., "text/" for "text/html") > - (id)_webkit_objectForMIMEType:(NSString *)MIMEType; >-@end > >-@interface NSMutableDictionary (WebNSDictionaryExtras) >-- (void)_webkit_setInt:(int)value forKey:(id)key; >-- (void)_webkit_setFloat:(float)value forKey:(id)key; >-- (void)_webkit_setBool:(BOOL)value forKey:(id)key; >-- (void)_webkit_setLongLong:(long long)value forKey:(id)key; >-- (void)_webkit_setUnsignedLongLong:(unsigned long long)value forKey:(id)key; >-- (void)_webkit_setUnsignedInt:(unsigned)value forKey:(id)key; > @end >diff --git a/Source/WebKitLegacy/mac/Misc/WebNSDictionaryExtras.m b/Source/WebKitLegacy/mac/Misc/WebNSDictionaryExtras.m >index f1a1b031c00782df88b5a84b37afdc3c4c308301..d8b6900b19e6b328c82ec38e75a21bdc5be15207 100644 >--- a/Source/WebKitLegacy/mac/Misc/WebNSDictionaryExtras.m >+++ b/Source/WebKitLegacy/mac/Misc/WebNSDictionaryExtras.m >@@ -31,18 +31,13 @@ > #import <wtf/Assertions.h> > > @implementation NSDictionary (WebNSDictionaryExtras) >+ > -(NSNumber *)_webkit_numberForKey:(id)key > { > id object = [self objectForKey:key]; > return [object isKindOfClass:[NSNumber class]] ? object : nil; > } > >--(int)_webkit_intForKey:(NSString *)key >-{ >- NSNumber *number = [self _webkit_numberForKey:key]; >- return number == nil ? 0 : [number intValue]; >-} >- > -(NSString *)_webkit_stringForKey:(id)key > { > id object = [self objectForKey:key]; >@@ -80,50 +75,3 @@ - (BOOL)_webkit_boolForKey:(id)key > } > > @end >- >-@implementation NSMutableDictionary (WebNSDictionaryExtras) >- >--(void)_webkit_setInt:(int)value forKey:(id)key >-{ >- NSNumber *object = [[NSNumber alloc] initWithInt:value]; >- [self setObject:object forKey:key]; >- [object release]; >-} >- >--(void)_webkit_setFloat:(float)value forKey:(id)key >-{ >- NSNumber *object = [[NSNumber alloc] initWithFloat:value]; >- [self setObject:object forKey:key]; >- [object release]; >-} >- >--(void)_webkit_setBool:(BOOL)value forKey:(id)key >-{ >- NSNumber *object = [[NSNumber alloc] initWithBool:value]; >- [self setObject:object forKey:key]; >- [object release]; >-} >- >-- (void)_webkit_setLongLong:(long long)value forKey:(id)key >-{ >- NSNumber *object = [[NSNumber alloc] initWithLongLong:value]; >- [self setObject:object forKey:key]; >- [object release]; >-} >- >-- (void)_webkit_setUnsignedLongLong:(unsigned long long)value forKey:(id)key >-{ >- NSNumber *object = [[NSNumber alloc] initWithUnsignedLongLong:value]; >- [self setObject:object forKey:key]; >- [object release]; >-} >- >-- (void)_webkit_setUnsignedInt:(unsigned)value forKey:(id)key >-{ >- NSNumber *object = [[NSNumber alloc] initWithUnsignedInt:value]; >- [self setObject:object forKey:key]; >- [object release]; >-} >- >-@end >- >diff --git a/Source/WebKitLegacy/mac/Misc/WebStringTruncator.mm b/Source/WebKitLegacy/mac/Misc/WebStringTruncator.mm >index 1baef389d146e250760fd4035701a3f1ef4517cc..2685579d4b1d7a07570b413d45aeb95517705d79 100644 >--- a/Source/WebKitLegacy/mac/Misc/WebStringTruncator.mm >+++ b/Source/WebKitLegacy/mac/Misc/WebStringTruncator.mm >@@ -42,7 +42,7 @@ static WebCore::FontCascade& fontFromNSFont(NSFont *font) > if ([font isEqual:currentNSFont.get().get()]) > return currentFont; > currentNSFont.get() = font; >- currentFont.get() = WebCore::FontCascade(WebCore::FontPlatformData(reinterpret_cast<CTFontRef>(font), [font pointSize])); >+ currentFont.get() = WebCore::FontCascade(WebCore::FontPlatformData((__bridge CTFontRef)font, [font pointSize])); > return currentFont; > } > >diff --git a/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginHostManager.mm b/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginHostManager.mm >index 703c5462c8ef22a37b1dd86048e3ba161ab5f5b2..0210b066baad2697e09f28e089ad35fa74f369df 100644 >--- a/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginHostManager.mm >+++ b/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginHostManager.mm >@@ -117,11 +117,11 @@ static NSString *preferredBundleLocalizationName() > LangCode languageCode; > RegionCode regionCode; > >- Boolean success = CFLocaleGetLanguageRegionEncodingForLocaleIdentifier((CFStringRef)language, &languageCode, ®ionCode, nullptr, nullptr); >+ Boolean success = CFLocaleGetLanguageRegionEncodingForLocaleIdentifier((__bridge CFStringRef)language, &languageCode, ®ionCode, nullptr, nullptr); > if (!success) > return @"en_US"; > >- return adoptCF(CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes(0, languageCode, regionCode)).bridgingAutorelease(); >+ return CFBridgingRelease(CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes(0, languageCode, regionCode)); > } > > bool NetscapePluginHostManager::spawnPluginHost(const String& pluginPath, cpu_type_t pluginArchitecture, mach_port_t clientPort, mach_port_t& pluginHostPort, ProcessSerialNumber& pluginHostPSN) >diff --git a/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm b/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm >index 1c8d5326f14a90e76dd9a5aba821bdf79fd4d8e9..e93fb506e5de0a5dae3afa5658cbaf4178e26aa1 100644 >--- a/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm >+++ b/Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm >@@ -307,7 +307,7 @@ void NetscapePluginInstanceProxy::cleanup() > m_localObjects.clear(); > > if (Frame* frame = core([m_pluginView webFrame])) >- frame->script().cleanupScriptObjectsForPlugin(m_pluginView); >+ frame->script().cleanupScriptObjectsForPlugin((__bridge void*)m_pluginView); > > ProxyInstanceSet instances; > instances.swap(m_instances); >@@ -551,7 +551,7 @@ void NetscapePluginInstanceProxy::status(const char* message) > return; > > WebView *wv = [m_pluginView webView]; >- [[wv _UIDelegateForwarder] webView:wv setStatusText:(NSString *)status.get()]; >+ [[wv _UIDelegateForwarder] webView:wv setStatusText:(__bridge NSString *)status.get()]; > } > > NPError NetscapePluginInstanceProxy::loadURL(const char* url, const char* target, const char* postData, uint32_t postLen, LoadURLFlags flags, uint32_t& streamID) >@@ -572,12 +572,12 @@ NPError NetscapePluginInstanceProxy::loadURL(const char* url, const char* target > if (!bufString) > return NPERR_INVALID_PARAM; > >- NSURL *fileURL = [NSURL _web_URLWithDataAsString:(NSString *)bufString.get()]; >+ NSURL *fileURL = [NSURL _web_URLWithDataAsString:(__bridge NSString *)bufString.get()]; > NSString *path; > if ([fileURL isFileURL]) > path = [fileURL path]; > else >- path = (NSString *)bufString.get(); >+ path = (__bridge NSString *)bufString.get(); > httpBody = [NSData dataWithContentsOfFile:path]; > if (!httpBody) > return NPERR_FILE_NOT_FOUND; >@@ -1415,7 +1415,7 @@ bool NetscapePluginInstanceProxy::demarshalValueFromArray(ExecState* exec, NSArr > if (!frame->script().canExecuteScripts(NotAboutToExecuteScript)) > return false; > >- auto rootObject = frame->script().createRootObject(m_pluginView); >+ auto rootObject = frame->script().createRootObject((__bridge void*)m_pluginView); > result = ProxyInstance::create(WTFMove(rootObject), this, objectID)->createRuntimeObject(exec); > return true; > } >diff --git a/Source/WebKitLegacy/mac/Plugins/Hosted/ProxyInstance.mm b/Source/WebKitLegacy/mac/Plugins/Hosted/ProxyInstance.mm >index 0d326c256676739ba7f12273c7b7b0ddbd4ac42c..fe508860ec7979dd6d006510a58d80ed6e4cc169 100644 >--- a/Source/WebKitLegacy/mac/Plugins/Hosted/ProxyInstance.mm >+++ b/Source/WebKitLegacy/mac/Plugins/Hosted/ProxyInstance.mm >@@ -317,7 +317,7 @@ void ProxyInstance::getPropertyNames(ExecState* exec, PropertyNameArray& nameArr > if (!reply || !reply->m_returnValue) > return; > >- NSArray *array = [NSPropertyListSerialization propertyListWithData:(NSData *)reply->m_result.get() options:NSPropertyListImmutable format:nullptr error:nullptr]; >+ NSArray *array = [NSPropertyListSerialization propertyListWithData:(__bridge NSData *)reply->m_result.get() options:NSPropertyListImmutable format:nullptr error:nullptr]; > > for (NSNumber *number in array) { > IdentifierRep* identifier = reinterpret_cast<IdentifierRep*>([number longLongValue]); >diff --git a/Source/WebKitLegacy/mac/Plugins/WebBasePluginPackage.mm b/Source/WebKitLegacy/mac/Plugins/WebBasePluginPackage.mm >index 93ecb296578ffd72b679d9f1b1b42d7dba1da7f0..dd11355e9821a2efe574aecfb6d49c9533795731 100644 >--- a/Source/WebKitLegacy/mac/Plugins/WebBasePluginPackage.mm >+++ b/Source/WebKitLegacy/mac/Plugins/WebBasePluginPackage.mm >@@ -131,7 +131,7 @@ - (id)_objectForInfoDictionaryKey:(NSString *)key > if (!bundleInfoDictionary) > return nil; > >- return (id)CFDictionaryGetValue(bundleInfoDictionary, key); >+ return (__bridge id)CFDictionaryGetValue(bundleInfoDictionary, (__bridge CFStringRef)key); > } > > - (BOOL)getPluginInfoFromPLists >diff --git a/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginEventHandlerCocoa.mm b/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginEventHandlerCocoa.mm >index f575893d1a570bf33243f1413a797ac19deb3259..d58181a0d7802349a5594ea5ad60dd5c36291a83 100644 >--- a/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginEventHandlerCocoa.mm >+++ b/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginEventHandlerCocoa.mm >@@ -210,9 +210,9 @@ void WebNetscapePluginEventHandlerCocoa::focusChanged(bool hasFocus) > removeKeyEventHandler(); > } > >-void* WebNetscapePluginEventHandlerCocoa::platformWindow(NSWindow* window) >+void* WebNetscapePluginEventHandlerCocoa::platformWindow(NSWindow *window) > { >- return window; >+ return (__bridge void*)window; > } > > bool WebNetscapePluginEventHandlerCocoa::sendEvent(NPCocoaEvent* event) >diff --git a/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginPackage.mm b/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginPackage.mm >index f6213f377df76d1231e2e8cfd192cf2158dfaf9f..f2289347421904bee3c88666c4e30092fc1050de 100644 >--- a/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginPackage.mm >+++ b/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginPackage.mm >@@ -76,11 +76,10 @@ - (BOOL)_initWithPath:(NSString *)pluginPath > return NO; > > #if USE(PLUGIN_HOST_PROCESS) >- RetainPtr<CFArrayRef> archs = adoptCF(CFBundleCopyExecutableArchitectures(cfBundle.get())); >- >- if ([(NSArray *)archs.get() containsObject:[NSNumber numberWithInteger:NSBundleExecutableArchitectureX86_64]]) >+ auto archs = adoptCF(CFBundleCopyExecutableArchitectures(cfBundle.get())); >+ if ([(__bridge NSArray *)archs.get() containsObject:@(NSBundleExecutableArchitectureX86_64)]) > pluginHostArchitecture = CPU_TYPE_X86_64; >- else if ([(NSArray *)archs.get() containsObject:[NSNumber numberWithInteger:NSBundleExecutableArchitectureI386]]) >+ else if ([(__bridge NSArray *)archs.get() containsObject:@(NSBundleExecutableArchitectureI386)]) > pluginHostArchitecture = CPU_TYPE_X86; > else > return NO; >@@ -94,7 +93,6 @@ - (BOOL)_initWithPath:(NSString *)pluginPath > > if (![self isNativeLibraryData:data]) > return NO; >- > #endif > > if (![self getPluginInfoFromPLists]) >@@ -120,6 +118,7 @@ - (id)initWithPath:(NSString *)pluginPath > } > > #if USE(PLUGIN_HOST_PROCESS) >+ > - (cpu_type_t)pluginHostArchitecture > { > return pluginHostArchitecture; >diff --git a/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginView.mm b/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginView.mm >index b2b11d34cff57ec00406acff7c0e258ffb0357c8..49dc1c514f72c449ffdae729ca8d9c08164a9e3e 100644 >--- a/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginView.mm >+++ b/Source/WebKitLegacy/mac/Plugins/WebNetscapePluginView.mm >@@ -1724,19 +1724,18 @@ - (NPError)_postURL:(const char *)URLCString > > if (file) { > // If we're posting a file, buf is either a file URL or a path to the file. >- NSString *bufString = (NSString *)CFStringCreateWithCString(kCFAllocatorDefault, buf, kCFStringEncodingWindowsLatin1); >+ auto bufString = adoptCF(CFStringCreateWithCString(kCFAllocatorDefault, buf, kCFStringEncodingWindowsLatin1)); > if (!bufString) { > return NPERR_INVALID_PARAM; > } >- NSURL *fileURL = [NSURL _web_URLWithDataAsString:bufString]; >+ NSURL *fileURL = [NSURL _web_URLWithDataAsString:(__bridge NSString *)bufString.get()]; > NSString *path; > if ([fileURL isFileURL]) { > path = [fileURL path]; > } else { >- path = bufString; >+ path = (__bridge NSString *)bufString.get(); > } > postData = [NSData dataWithContentsOfFile:path]; >- CFRelease(bufString); > if (!postData) { > return NPERR_FILE_NOT_FOUND; > } >@@ -1866,7 +1865,7 @@ -(void)status:(const char *)message > > LOG(Plugins, "NPN_Status: %@", status); > WebView *wv = [self webView]; >- [[wv _UIDelegateForwarder] webView:wv setStatusText:(NSString *)status]; >+ [[wv _UIDelegateForwarder] webView:wv setStatusText:(__bridge NSString *)status]; > CFRelease(status); > } > >@@ -2120,7 +2119,7 @@ - (NPError)popUpContextMenu:(NPMenu *)menu > if (!currentEvent) > return NPERR_GENERIC_ERROR; > >- [NSMenu popUpContextMenu:(NSMenu *)menu withEvent:currentEvent forView:self]; >+ [NSMenu popUpContextMenu:(__bridge NSMenu *)menu withEvent:currentEvent forView:self]; > return NPERR_NO_ERROR; > } > >diff --git a/Source/WebKitLegacy/mac/Plugins/WebPluginController.mm b/Source/WebKitLegacy/mac/Plugins/WebPluginController.mm >index df127fe0cddae6a6f419f6d40cc5eb4734f9ac47..290fef63ad916aa618d30a21d9143e218ec90e85 100644 >--- a/Source/WebKitLegacy/mac/Plugins/WebPluginController.mm >+++ b/Source/WebKitLegacy/mac/Plugins/WebPluginController.mm >@@ -410,7 +410,7 @@ static void cancelOutstandingCheck(const void *item, void *context) > - (void)_cancelOutstandingChecks > { > if (_checksInProgress) { >- CFSetApplyFunction((CFSetRef)_checksInProgress, cancelOutstandingCheck, NULL); >+ CFSetApplyFunction((__bridge CFSetRef)_checksInProgress, cancelOutstandingCheck, NULL); > [_checksInProgress release]; > _checksInProgress = nil; > } >diff --git a/Source/WebKitLegacy/mac/Plugins/WebPluginDatabase.mm b/Source/WebKitLegacy/mac/Plugins/WebPluginDatabase.mm >index d86f2319c4d7789684a7dfa030adb3009cff23e8..b7697e70307393cb57b6233d74436d2a7a92b19c 100644 >--- a/Source/WebKitLegacy/mac/Plugins/WebPluginDatabase.mm >+++ b/Source/WebKitLegacy/mac/Plugins/WebPluginDatabase.mm >@@ -86,7 +86,7 @@ + (void)closeSharedDatabase > [sharedDatabase close]; > } > >-static void checkCandidate(WebBasePluginPackage **currentPlugin, WebBasePluginPackage **candidatePlugin) >+static void checkCandidate(WebBasePluginPackage * __strong *currentPlugin, WebBasePluginPackage * __strong *candidatePlugin) > { > if (!*currentPlugin) { > *currentPlugin = *candidatePlugin; >diff --git a/Source/WebKitLegacy/mac/Plugins/npapi.mm b/Source/WebKitLegacy/mac/Plugins/npapi.mm >index 23e4e467f0ee5c0210acc58f5cb3d4aba4a88dd1..c3ea74a8696fd41a284056f4c922e2c9f01f4801 100644 >--- a/Source/WebKitLegacy/mac/Plugins/npapi.mm >+++ b/Source/WebKitLegacy/mac/Plugins/npapi.mm >@@ -73,7 +73,7 @@ NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList) > WebNetscapePluginView *pluginViewForInstance(NPP instance) > { > if (instance && instance->ndata) >- return (WebNetscapePluginView *)instance->ndata; >+ return (__bridge WebNetscapePluginView *)instance->ndata; > else > return [WebNetscapePluginView currentPluginView]; > } >diff --git a/Source/WebKitLegacy/mac/Storage/WebDatabaseManager.mm b/Source/WebKitLegacy/mac/Storage/WebDatabaseManager.mm >index 0051f582dd5462fdfe5ff837e0c19a0640107d35..ceece13fa2ae4816cb6066b448e819faf7819fcc 100644 >--- a/Source/WebKitLegacy/mac/Storage/WebDatabaseManager.mm >+++ b/Source/WebKitLegacy/mac/Storage/WebDatabaseManager.mm >@@ -118,16 +118,15 @@ - (NSDictionary *)detailsForDatabase:(NSString *)databaseIdentifier withOrigin:( > if (!origin) > return nil; > >- DatabaseDetails details = DatabaseManager::singleton().detailsForNameAndOrigin(databaseIdentifier, *[origin _core]); >+ auto details = DatabaseManager::singleton().detailsForNameAndOrigin(databaseIdentifier, *[origin _core]); > if (details.name().isNull()) > return nil; >- >- static const id keys[3] = { WebDatabaseDisplayNameKey, WebDatabaseExpectedSizeKey, WebDatabaseUsageKey }; >- id objects[3]; >- objects[0] = details.displayName().isEmpty() ? databaseIdentifier : (NSString *)details.displayName(); >- objects[1] = [NSNumber numberWithUnsignedLongLong:details.expectedUsage()]; >- objects[2] = [NSNumber numberWithUnsignedLongLong:details.currentUsage()]; >- return [[[NSDictionary alloc] initWithObjects:objects forKeys:keys count:3] autorelease]; >+ >+ return @{ >+ WebDatabaseDisplayNameKey: details.displayName().isEmpty() ? databaseIdentifier : (NSString *)details.displayName(), >+ WebDatabaseExpectedSizeKey: @(details.expectedUsage()), >+ WebDatabaseUsageKey: @(details.currentUsage()), >+ }; > } > > - (void)deleteAllDatabases >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebContextMenuClient.mm b/Source/WebKitLegacy/mac/WebCoreSupport/WebContextMenuClient.mm >index 0ec1223ca141074e31adbf8e6c3c93002f8c2706..e0dd64647c814aa7df858a932538e0e3d460591f 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebContextMenuClient.mm >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebContextMenuClient.mm >@@ -32,16 +32,13 @@ > > #import "WebDelegateImplementationCaching.h" > #import "WebElementDictionary.h" >-#import "WebFrame.h" > #import "WebFrameInternal.h" >-#import "WebHTMLView.h" >+#import "WebFrameView.h" > #import "WebHTMLViewInternal.h" > #import "WebKitVersionChecks.h" > #import "WebNSPasteboardExtras.h" > #import "WebSharingServicePickerController.h" >-#import "WebUIDelegate.h" > #import "WebUIDelegatePrivate.h" >-#import "WebView.h" > #import "WebViewInternal.h" > #import <WebCore/BitmapImage.h> > #import <WebCore/ContextMenu.h> >@@ -121,7 +118,7 @@ bool WebContextMenuClient::isSpeaking() > > void WebContextMenuClient::speak(const String& string) > { >- [NSApp speakString:[[(NSString*)string copy] autorelease]]; >+ [NSApp speakString:(NSString *)string]; > } > > void WebContextMenuClient::stopSpeaking() >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.mm b/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.mm >index 2eff76112ea9f895854835618fec7c872dbebf36..d311dd65f170c1b25d47a3279753a5d535b575eb 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.mm >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.mm >@@ -45,7 +45,7 @@ > #import "WebEditingDelegatePrivate.h" > #import "WebFormDelegate.h" > #import "WebFrameInternal.h" >-#import "WebHTMLView.h" >+#import "WebFrameView.h" > #import "WebHTMLViewInternal.h" > #import "WebKitLogging.h" > #import "WebKitVersionChecks.h" >@@ -772,7 +772,7 @@ void WebEditorClient::handleKeyboardEvent(KeyboardEvent* event) > { > auto* frame = downcast<Node>(event->target())->document().frame(); > #if !PLATFORM(IOS) >- WebHTMLView *webHTMLView = [[kit(frame) frameView] documentView]; >+ WebHTMLView *webHTMLView = (WebHTMLView *)[[kit(frame) frameView] documentView]; > if ([webHTMLView _interpretKeyEvent:event savingCommands:NO]) > event->setDefaultHandled(); > #else >@@ -787,7 +787,7 @@ void WebEditorClient::handleInputMethodKeydown(KeyboardEvent* event) > #if !PLATFORM(IOS) > // FIXME: Switch to WebKit2 model, interpreting the event before it's sent down to WebCore. > auto* frame = downcast<Node>(event->target())->document().frame(); >- WebHTMLView *webHTMLView = [[kit(frame) frameView] documentView]; >+ WebHTMLView *webHTMLView = (WebHTMLView *)[[kit(frame) frameView] documentView]; > if ([webHTMLView _interpretKeyEvent:event savingCommands:YES]) > event->setDefaultHandled(); > #else >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameNetworkingContext.mm b/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameNetworkingContext.mm >index 19f51cd0e08b974eeb578605de7d30646b8ee2d7..661a37c5d577fee065d7a32f23e0f27bbfd66511 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameNetworkingContext.mm >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameNetworkingContext.mm >@@ -77,7 +77,7 @@ RetainPtr<CFDataRef> WebFrameNetworkingContext::sourceApplicationAuditData() con > if (!webview) > return nullptr; > >- return reinterpret_cast<CFDataRef>(webview._sourceApplicationAuditData); >+ return (__bridge CFDataRef)webview._sourceApplicationAuditData; > } > > String WebFrameNetworkingContext::sourceApplicationIdentifier() const >diff --git a/Source/WebKitLegacy/mac/WebCoreSupport/WebSecurityOriginPrivate.h b/Source/WebKitLegacy/mac/WebCoreSupport/WebSecurityOriginPrivate.h >index 5fe1b0ba31b6c0109ce467dc41e031f9cd1b1b34..d6e5399f54d9df85d92ac416021cc1954e05ba6e 100644 >--- a/Source/WebKitLegacy/mac/WebCoreSupport/WebSecurityOriginPrivate.h >+++ b/Source/WebKitLegacy/mac/WebCoreSupport/WebSecurityOriginPrivate.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2007, 2010, 2012 Apple Inc. All rights reserved. >+ * Copyright (C) 2007-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 >@@ -26,7 +26,8 @@ > * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > */ > >-@class WebSecurityOriginPrivate; >+struct WebSecurityOriginPrivate; >+ > @protocol WebQuotaManager; > > @interface WebSecurityOrigin : NSObject { >diff --git a/Source/WebKitLegacy/mac/WebInspector/WebNodeHighlighter.mm b/Source/WebKitLegacy/mac/WebInspector/WebNodeHighlighter.mm >index b4aca6f7b878e94200f234216180fc4c59b740fb..7e907c980ad9fc910befb34850ee7b930d939bab 100644 >--- a/Source/WebKitLegacy/mac/WebInspector/WebNodeHighlighter.mm >+++ b/Source/WebKitLegacy/mac/WebInspector/WebNodeHighlighter.mm >@@ -29,7 +29,9 @@ > #import "WebNodeHighlighter.h" > > #import "DOMNodeInternal.h" >+#import "WebFrameView.h" > #import "WebNodeHighlight.h" >+#import "WebNodeHighlightView.h" > #import "WebViewInternal.h" > #import <WebCore/Page.h> > >diff --git a/Source/WebKitLegacy/mac/WebView/WebFullScreenController.mm b/Source/WebKitLegacy/mac/WebView/WebFullScreenController.mm >index fd3d3520e38dc19544364e5b0efb0d3010e167c3..753dceb28d30e6a90f4017d9f01e3d4edfff1539 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebFullScreenController.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebFullScreenController.mm >@@ -224,7 +224,7 @@ - (void)enterFullScreen:(NSScreen *)screen > [_webViewPlaceholder.get() setLayer:[CALayer layer]]; > [_webViewPlaceholder.get() setWantsLayer:YES]; > } >- [[_webViewPlaceholder.get() layer] setContents:(id)webViewContents.get()]; >+ [[_webViewPlaceholder.get() layer] setContents:(__bridge id)webViewContents.get()]; > _scrollPosition = [_webView _mainCoreFrame]->view()->scrollPosition(); > [self _swapView:_webView with:_webViewPlaceholder.get()]; > >diff --git a/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm b/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm >index f52a48c1443b22d4205d4a91b32e6a68b3729363..66fbeb207200dd6a68a4c672a11319c509b399cb 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm >@@ -1335,7 +1335,7 @@ - (void)_writeSelectionWithPasteboardTypes:(NSArray *)types toPasteboard:(NSPast > if ([types containsObject:WebArchivePboardType]) { > if (RefPtr<LegacyWebArchive> coreArchive = LegacyWebArchive::createFromSelection(core([self _frame]))) { > if (RetainPtr<CFDataRef> data = coreArchive ? coreArchive->rawDataRepresentation() : 0) >- [pasteboard setData:(NSData *)data.get() forType:WebArchivePboardType]; >+ [pasteboard setData:(__bridge NSData *)data.get() forType:WebArchivePboardType]; > } > } > >@@ -2020,7 +2020,7 @@ - (void)pasteboard:(NSPasteboard *)pasteboard provideDataForType:(NSString *)typ > [pasteboard _web_writePromisedRTFDFromArchive:archive.get() containsImage:[[pasteboard types] containsObject:legacyTIFFPasteboardType()]]; > } else if ([type isEqualToString:legacyTIFFPasteboardType()] && _private->promisedDragTIFFDataSource) { > if (auto* image = _private->promisedDragTIFFDataSource->image()) >- [pasteboard setData:(NSData *)image->tiffRepresentation() forType:legacyTIFFPasteboardType()]; >+ [pasteboard setData:(__bridge NSData *)image->tiffRepresentation() forType:legacyTIFFPasteboardType()]; > [self setPromisedDragTIFFDataSource:nullptr]; > } > } >diff --git a/Source/WebKitLegacy/mac/WebView/WebImmediateActionController.mm b/Source/WebKitLegacy/mac/WebView/WebImmediateActionController.mm >index 926d4e4264e92e2e2a07d398568e5d31a3166dc3..551589a24c3de7c109e5e153f585512e7c5b555c 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebImmediateActionController.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebImmediateActionController.mm >@@ -32,7 +32,7 @@ > #import "DOMRangeInternal.h" > #import "WebElementDictionary.h" > #import "WebFrameInternal.h" >-#import "WebHTMLView.h" >+#import "WebFrameView.h" > #import "WebHTMLViewInternal.h" > #import "WebUIDelegatePrivate.h" > #import "WebViewInternal.h" >@@ -145,11 +145,12 @@ - (void)_clearImmediateActionState > > - (void)performHitTestAtPoint:(NSPoint)viewPoint > { >- Frame* coreFrame = core([[[[_webView _selectedOrMainFrame] frameView] documentView] _frame]); >+ Frame* coreFrame = core([_webView _selectedOrMainFrame]); > if (!coreFrame) > return; >+ > _hitTestResult = coreFrame->eventHandler().hitTestResultAtPoint(IntPoint(viewPoint)); >- coreFrame->eventHandler().setImmediateActionStage(ImmediateActionStage::PerformedHitTest); >+ coreFrame->mainFrame().eventHandler().setImmediateActionStage(ImmediateActionStage::PerformedHitTest); > > if (Element* element = _hitTestResult.targetElement()) > _contentPreventsDefault = element->dispatchMouseForceWillBegin(); >@@ -205,10 +206,9 @@ - (void)immediateActionRecognizerDidUpdateAnimation:(NSImmediateActionGestureRec > if (immediateActionRecognizer != _immediateActionRecognizer) > return; > >- Frame* coreFrame = core([[[[_webView _selectedOrMainFrame] frameView] documentView] _frame]); >- if (!coreFrame) >- return; >- coreFrame->eventHandler().setImmediateActionStage(ImmediateActionStage::ActionUpdated); >+ if (Frame* coreFrame = [_webView _mainCoreFrame]) >+ coreFrame->eventHandler().setImmediateActionStage(ImmediateActionStage::ActionUpdated); >+ > if (_contentPreventsDefault) > return; > >@@ -220,12 +220,7 @@ - (void)immediateActionRecognizerDidCancelAnimation:(NSImmediateActionGestureRec > if (immediateActionRecognizer != _immediateActionRecognizer) > return; > >- NSView *documentView = [[[_webView _selectedOrMainFrame] frameView] documentView]; >- if (![documentView isKindOfClass:[WebHTMLView class]]) >- return; >- >- Frame* coreFrame = core([(WebHTMLView *)documentView _frame]); >- if (coreFrame) { >+ if (Frame* coreFrame = [_webView _mainCoreFrame]) { > ImmediateActionStage lastStage = coreFrame->eventHandler().immediateActionStage(); > if (lastStage == ImmediateActionStage::ActionUpdated) > coreFrame->eventHandler().setImmediateActionStage(ImmediateActionStage::ActionCancelledAfterUpdate); >@@ -244,10 +239,8 @@ - (void)immediateActionRecognizerDidCompleteAnimation:(NSImmediateActionGestureR > if (immediateActionRecognizer != _immediateActionRecognizer) > return; > >- Frame* coreFrame = core([[[[_webView _selectedOrMainFrame] frameView] documentView] _frame]); >- if (!coreFrame) >- return; >- coreFrame->eventHandler().setImmediateActionStage(ImmediateActionStage::ActionCompleted); >+ if (Frame* coreFrame = [_webView _mainCoreFrame]) >+ coreFrame->eventHandler().setImmediateActionStage(ImmediateActionStage::ActionCompleted); > > [_webView _setTextIndicatorAnimationProgress:1]; > [_webView _setMaintainsInactiveSelection:NO]; >diff --git a/Source/WebKitLegacy/mac/WebView/WebJSPDFDoc.mm b/Source/WebKitLegacy/mac/WebView/WebJSPDFDoc.mm >index 24169fe0a4e6feb23d9d8de3fe1e81706b718b4b..e8bf4b5135b8fde95a3bc50214a5aaea9ef32554 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebJSPDFDoc.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebJSPDFDoc.mm >@@ -33,19 +33,17 @@ > > static void jsPDFDocInitialize(JSContextRef ctx, JSObjectRef object) > { >- WebDataSource *dataSource = (WebDataSource *)JSObjectGetPrivate(object); >- CFRetain(dataSource); >+ CFRetain(JSObjectGetPrivate(object)); > } > > static void jsPDFDocFinalize(JSObjectRef object) > { >- WebDataSource *dataSource = (WebDataSource *)JSObjectGetPrivate(object); >- CFRelease(dataSource); >+ CFRelease(JSObjectGetPrivate(object)); > } > > static JSValueRef jsPDFDocPrint(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) > { >- WebDataSource *dataSource = (WebDataSource *)JSObjectGetPrivate(thisObject); >+ WebDataSource *dataSource = (__bridge WebDataSource *)JSObjectGetPrivate(thisObject); > > WebView *webView = [[dataSource webFrame] webView]; > CallUIDelegate(webView, @selector(webView:printFrameView:), [[dataSource webFrame] frameView]); >@@ -72,5 +70,5 @@ JSObjectRef makeJSPDFDoc(JSContextRef ctx, WebDataSource *dataSource) > { > static JSClassRef jsPDFDocClass = JSClassCreate(&jsPDFDocClassDefinition); > >- return JSObjectMake(ctx, jsPDFDocClass, dataSource); >+ return JSObjectMake(ctx, jsPDFDocClass, (__bridge void*)dataSource); > } >diff --git a/Source/WebKitLegacy/mac/WebView/WebPDFView.mm b/Source/WebKitLegacy/mac/WebView/WebPDFView.mm >index 26b25edc1e8813b132317ae9616a8713e1a0fc20..9ab23386de37dde6c2980e3f193e2a7533300ea1 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebPDFView.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebPDFView.mm >@@ -26,10 +26,10 @@ > * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > */ > >-#if !PLATFORM(IOS) >- > #import "WebPDFView.h" > >+#if PLATFORM(MAC) >+ > #import "DOMNodeInternal.h" > #import "DOMRangeInternal.h" > #import "PDFViewSPI.h" >@@ -128,12 +128,12 @@ static void _applicationInfoForMIMEType(NSString *type, NSString **name, NSImage > > #pragma clang diagnostic push > #pragma clang diagnostic ignored "-Wdeprecated-declarations" >- OSStatus error = LSCopyApplicationForMIMEType((CFStringRef)type, kLSRolesAll, &appURL); >+ OSStatus error = LSCopyApplicationForMIMEType((__bridge CFStringRef)type, kLSRolesAll, &appURL); > #pragma clang diagnostic pop > if (error != noErr) > return; > >- NSString *appPath = [(NSURL *)appURL path]; >+ NSString *appPath = [(__bridge NSURL *)appURL path]; > CFRelease(appURL); > > *image = [[NSWorkspace sharedWorkspace] iconForFile:appPath]; >@@ -1594,4 +1594,4 @@ - (NSMethodSignature *)methodSignatureForSelector:(SEL)sel > > @end > >-#endif // !PLATFORM(IOS) >+#endif // PLATFORM(MAC) >diff --git a/Source/WebKitLegacy/mac/WebView/WebPreferences.mm b/Source/WebKitLegacy/mac/WebView/WebPreferences.mm >index 1f65df0266dade9a6738249487846ab8fe9fb27c..4afda34d0606302c7ff7759ec4a9db616170bc87 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebPreferences.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebPreferences.mm >@@ -764,7 +764,7 @@ - (void)_setIntegerValue:(int)value forKey:(NSString *)key > #if PLATFORM(IOS) > dispatch_barrier_sync(_private->readWriteQueue, ^{ > #endif >- [_private->values.get() _webkit_setInt:value forKey:_key]; >+ [_private->values.get() setObject:@(value) forKey:_key]; > #if PLATFORM(IOS) > }); > #endif >@@ -787,7 +787,7 @@ - (void)_setUnsignedIntValue:(unsigned int)value forKey:(NSString *)key > #if PLATFORM(IOS) > dispatch_barrier_sync(_private->readWriteQueue, ^{ > #endif >- [_private->values.get() _webkit_setUnsignedInt:value forKey:_key]; >+ [_private->values.get() setObject:@(value) forKey:_key]; > #if PLATFORM(IOS) > }); > #endif >@@ -810,7 +810,7 @@ - (void)_setFloatValue:(float)value forKey:(NSString *)key > #if PLATFORM(IOS) > dispatch_barrier_sync(_private->readWriteQueue, ^{ > #endif >- [_private->values.get() _webkit_setFloat:value forKey:_key]; >+ [_private->values.get() setObject:@(value) forKey:_key]; > #if PLATFORM(IOS) > }); > #endif >@@ -832,7 +832,7 @@ - (void)_setBoolValue:(BOOL)value forKey:(NSString *)key > #if PLATFORM(IOS) > dispatch_barrier_sync(_private->readWriteQueue, ^{ > #endif >- [_private->values.get() _webkit_setBool:value forKey:_key]; >+ [_private->values.get() setObject:@(value) forKey:_key]; > #if PLATFORM(IOS) > }); > #endif >@@ -855,7 +855,7 @@ - (void)_setLongLongValue:(long long)value forKey:(NSString *)key > #if PLATFORM(IOS) > dispatch_barrier_sync(_private->readWriteQueue, ^{ > #endif >- [_private->values.get() _webkit_setLongLong:value forKey:_key]; >+ [_private->values.get() setObject:@(value) forKey:_key]; > #if PLATFORM(IOS) > }); > #endif >@@ -878,7 +878,7 @@ - (void)_setUnsignedLongLongValue:(unsigned long long)value forKey:(NSString *)k > #if PLATFORM(IOS) > dispatch_barrier_sync(_private->readWriteQueue, ^{ > #endif >- [_private->values.get() _webkit_setUnsignedLongLong:value forKey:_key]; >+ [_private->values.get() setObject:@(value) forKey:_key]; > #if PLATFORM(IOS) > }); > #endif >diff --git a/Source/WebKitLegacy/mac/WebView/WebView.mm b/Source/WebKitLegacy/mac/WebView/WebView.mm >index 9cff0bd6591c5a5337ced851df7c1086001be090..d4d1e6efceaa6dbc493e86e26ce4f81611ea03df 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebView.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebView.mm >@@ -1114,13 +1114,13 @@ + (void)_makeAllWebViewsPerformSelector:(SEL)selector > if (!allWebViewsSet) > return; > >- [(NSMutableSet *)allWebViewsSet makeObjectsPerformSelector:selector]; >+ [(__bridge NSMutableSet *)allWebViewsSet makeObjectsPerformSelector:selector]; > } > > - (void)_removeFromAllWebViewsSet > { > if (allWebViewsSet) >- CFSetRemoveValue(allWebViewsSet, self); >+ CFSetRemoveValue(allWebViewsSet, (__bridge CFTypeRef)self); > } > > - (void)_addToAllWebViewsSet >@@ -1128,7 +1128,7 @@ - (void)_addToAllWebViewsSet > if (!allWebViewsSet) > allWebViewsSet = CFSetCreateMutable(NULL, 0, &NonRetainingSetCallbacks); > >- CFSetSetValue(allWebViewsSet, self); >+ CFSetSetValue(allWebViewsSet, (__bridge CFTypeRef)self); > } > > @end >@@ -2113,10 +2113,7 @@ + (void)closeAllWebViews > DOMWindow::dispatchAllPendingUnloadEvents(); > > // This will close the WebViews in a random order. Change this if close order is important. >- // Make a new set to avoid mutating the set we are enumerating. >- NSSet *webViewsToClose = [NSSet setWithSet:(NSSet *)allWebViewsSet]; >- NSEnumerator *enumerator = [webViewsToClose objectEnumerator]; >- while (WebView *webView = [enumerator nextObject]) >+ for (WebView *webView in [(__bridge NSSet *)allWebViewsSet allObjects]) > [webView close]; > } > >@@ -6174,11 +6171,6 @@ - (void)_windowWillOrderOffScreen:(NSNotification *)notification > } > } > >-- (void)_windowVisibilityChanged:(NSNotification *)notification >-{ >- [self _updateVisibilityState]; >-} >- > - (void)_windowWillClose:(NSNotification *)notification > { > if ([self shouldCloseWithWindow] && ([self window] == [self hostWindow] || ([self window] && ![self hostWindow]) || (![self window] && [self hostWindow]))) >@@ -10066,6 +10058,11 @@ - (id)candidateList > > #endif > >+- (void)_windowVisibilityChanged:(NSNotification *)notification >+{ >+ [self _updateVisibilityState]; >+} >+ > @end > > @implementation WebView (WebViewDeviceOrientation) >diff --git a/Source/WebKitLegacy/mac/WebView/WebViewData.mm b/Source/WebKitLegacy/mac/WebView/WebViewData.mm >index 68253714a04570898f0ebd6c6e43ade5d96a3796..6492e4aaea2abd6f4d590751b32c552d7c1578b0 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebViewData.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebViewData.mm >@@ -33,6 +33,7 @@ > #import "WebPreferenceKeysPrivate.h" > #import "WebSelectionServiceController.h" > #import "WebViewGroup.h" >+#import "WebViewInternal.h" > #import <JavaScriptCore/InitializeThreading.h> > #import <WebCore/AlternativeTextUIController.h> > #import <WebCore/HistoryItem.h> >diff --git a/Source/WebKitLegacy/mac/WebView/WebViewInternal.h b/Source/WebKitLegacy/mac/WebView/WebViewInternal.h >index 90fa38770859ef1e8bacffac42fcc10a05e5499a..0e7c5d7e92e28b2efe62fa7ce3ad912a47f093d8 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebViewInternal.h >+++ b/Source/WebKitLegacy/mac/WebView/WebViewInternal.h >@@ -146,6 +146,8 @@ OBJC_CLASS NSTextAlternatives; > - (WebSelectionServiceController&)_selectionServiceController; > #endif > >+- (void)_windowVisibilityChanged:(NSNotification *)notification; >+ > @end > > #endif
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
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188245
:
346387
|
346479
|
346483
|
346499
|
346510
|
346557
|
346603
|
346604
|
346605
|
346629
|
346630