haikuwebkit/Source/WTF/wtf/ObjCRuntimeExtras.h

44 lines
2.0 KiB
C
Raw Permalink Normal View History

objc_msgSend and IMP should be cast appropriately before using https://bugs.webkit.org/show_bug.cgi?id=95242 Reviewed by Benjamin Poulain. Source/WebCore: Use wtfObjcMsgSend and wtfCallIMP templates which do appropriate casts to a function pointer with right types when calling objc_msgSend and an IMP method directly. No new tests because no functional changes. * page/mac/EventHandlerMac.mm: (WebCore::selfRetainingNSScrollViewScrollWheel): * platform/mac/WebCoreObjCExtras.mm: (deallocCallback): Source/WebKit/mac: Use wtfObjcMsgSend and wtfCallIMP templates which do appropriate casts to a function pointer with right types when calling objc_msgSend and an IMP method directly. * WebCoreSupport/WebCachedFramePlatformData.h: (WebCachedFramePlatformData::clear): * WebCoreSupport/WebDeviceOrientationClient.mm: (WebDeviceOrientationClient::getProvider): * WebView/WebDelegateImplementationCaching.mm: (CallDelegate): (CallDelegateReturningBoolean): (CallResourceLoadDelegateReturningBoolean): (CallFormDelegate): (CallFormDelegateReturningBoolean): * WebView/WebHTMLView.mm: (setCursor): (setNeedsDisplayInRect): Source/WebKit2: Use wtfObjcMsgSend and wtfCallIMP templates which do appropriate casts to a function pointer with right types when calling objc_msgSend and an IMP method directly. * UIProcess/API/mac/PDFViewController.mm: (WebKit::PDFViewScrollView_scrollWheel): Source/WTF: Add new templates wtfObjcMsgSend and wtfCallIMP that do the appropriate casts to correctly typed function pointers before calling objc_msgSend and IMP methods directly. * wtf/Functional.h: (WTF::R): Use wtfObjcMsgSend. * wtf/ObjcRuntimeExtras.h: Added. (wtfObjcMsgSend): (wtfCallIMP): Tools: Use wtfObjcMsgSend and wtfCallIMP templates which do appropriate casts to a function pointer with right types when calling objc_msgSend and an IMP method directly. * DumpRenderTree/mac/DumpRenderTree.mm: (drt_NSFontManager_availableFontFamilies): * WebKitTestRunner/InjectedBundle/mac/ActivateFonts.mm: (WTR::wtr_NSFontManager_availableFontFamilies): Canonical link: https://commits.webkit.org/113364@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@127193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-08-30 21:40:39 +00:00
/*
Fix issues found by the Clang Static Analyzer https://bugs.webkit.org/show_bug.cgi?id=120230 Reviewed by Darin Adler. Source/JavaScriptCore: * API/JSValue.mm: (valueToString): Don't leak every CFStringRef when in Objective-C GC. * API/ObjCCallbackFunction.mm: (JSC::ObjCCallbackFunctionImpl::~ObjCCallbackFunctionImpl): Don't release m_invocation's target since NSInvocation will do it for us on -dealloc. (objCCallbackFunctionForBlock): Tell NSInvocation to retain its target and -release our reference to the copied block. * API/tests/minidom.c: (createStringWithContentsOfFile): Free buffer before returning. * API/tests/testapi.c: (createStringWithContentsOfFile): Ditto. Source/WebCore: * WebCore.xcodeproj/project.pbxproj: Removed FoundationExtras.h. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: Removed CFAutoreleaseHelper(). (AXTextMarkerRange): Used HardAutorelease() instead of CFAutoreleaseHelper(). (AXTextMarkerRangeStart): Ditto. (AXTextMarkerRangeEnd): Ditto. (textMarkerForVisiblePosition): Ditto. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (-[WebCoreAVFMovieObserver initWithCallback:]): Called [super init] first so that we don't later use ivars from the wrong self. (-[WebCoreAVFLoaderDelegate initWithCallback:]): Ditto. * platform/mac/FoundationExtras.h: Removed. * platform/mac/KURLMac.mm: (WebCore::KURL::operator NSURL *): Used WTF's HardAutorelease(). * platform/mac/WebCoreNSURLExtras.mm: (WebCore::mapHostNameWithRange): Used HardAutorelease() instead of WebCoreCFAutorelease(). (WebCore::URLWithData): Ditto. (WebCore::userVisibleString): Ditto. (WebCore::URLByRemovingComponentAndSubsequentCharacter): Used Vector<> with an inline capacity rather than heap-allocating a buffer. * platform/mac/WebCoreObjCExtras.h: Used HardAutorelease() instead of WebCoreCFAutorelease(). * platform/text/mac/StringImplMac.mm: (WTF::StringImpl::operator NSString *): Used WTF's HardAutorelease(). Source/WebKit/mac: * Misc/WebNSFileManagerExtras.mm: (-[NSFileManager _webkit_startupVolumeName]): Used HardAutorelease() instead of WebCFAutorelease(). * Misc/WebNSObjectExtras.h: Removed definition of WebCFAutorelease(). * Misc/WebNSURLExtras.mm: (-[NSURL _web_URLWithLowercasedScheme]): Used HardAutorelease() instead of WebCFAutorelease(). * Plugins/Hosted/WebHostedNetscapePluginView.mm: (-[WebHostedNetscapePluginView createPluginLayer]): Stop leaking CGColors (CALayer retains its backgroundColor property despite the property attributes claiming otherwise). * Plugins/WebBasePluginPackage.mm: (+[WebBasePluginPackage preferredLocalizationName]): Used HardAutorelease() instead of WebCFAutorelease(). * WebView/WebDeviceOrientationProviderMock.mm: (-[WebDeviceOrientationProviderMockInternal lastOrientation]): Stop leaking WebDeviceOrientations. * WebView/WebPDFRepresentation.mm: (-[WebPDFRepresentation convertPostScriptDataSourceToPDF:]): Used HardAutorelease() instead of WebCFAutorelease(). * WebView/WebView.mm: (+[WebView _setCacheModel:]): Ditto. (-[WebView _removeObjectForIdentifier:]): Ditto. Source/WebKit2: * UIProcess/API/mac/WKBrowsingContextController.mm: (autoreleased): Don't leak CFURLs when in Objective-C GC. * WebProcess/WebPage/mac/WKAccessibilityWebPageObject.mm: (-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]): Don't leak CFStrings when in Objective-C GC. Source/WTF: * wtf/ObjcRuntimeExtras.h: (HardAutorelease): Added a canonical implementation of HardAutorelease. Tools: * DumpRenderTree/mac/DumpRenderTreePasteboard.m: (-[LocalPasteboard initWithName:]): Called [super init] first so that we don't later use ivars from the wrong self. * DumpRenderTree/mac/TestRunnerMac.mm: (-[APITestDelegate initWithCompletionCondition:]): Ditto. * TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsTest.mm: (TestWebKitAPI::TEST): Don't leak WKProcessGroups, WKBrowsingContextGroups, and WKViews. Canonical link: https://commits.webkit.org/138298@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-08-26 22:40:55 +00:00
* Copyright (C) 2012, 2013 Apple Inc. All rights reserved.
objc_msgSend and IMP should be cast appropriately before using https://bugs.webkit.org/show_bug.cgi?id=95242 Reviewed by Benjamin Poulain. Source/WebCore: Use wtfObjcMsgSend and wtfCallIMP templates which do appropriate casts to a function pointer with right types when calling objc_msgSend and an IMP method directly. No new tests because no functional changes. * page/mac/EventHandlerMac.mm: (WebCore::selfRetainingNSScrollViewScrollWheel): * platform/mac/WebCoreObjCExtras.mm: (deallocCallback): Source/WebKit/mac: Use wtfObjcMsgSend and wtfCallIMP templates which do appropriate casts to a function pointer with right types when calling objc_msgSend and an IMP method directly. * WebCoreSupport/WebCachedFramePlatformData.h: (WebCachedFramePlatformData::clear): * WebCoreSupport/WebDeviceOrientationClient.mm: (WebDeviceOrientationClient::getProvider): * WebView/WebDelegateImplementationCaching.mm: (CallDelegate): (CallDelegateReturningBoolean): (CallResourceLoadDelegateReturningBoolean): (CallFormDelegate): (CallFormDelegateReturningBoolean): * WebView/WebHTMLView.mm: (setCursor): (setNeedsDisplayInRect): Source/WebKit2: Use wtfObjcMsgSend and wtfCallIMP templates which do appropriate casts to a function pointer with right types when calling objc_msgSend and an IMP method directly. * UIProcess/API/mac/PDFViewController.mm: (WebKit::PDFViewScrollView_scrollWheel): Source/WTF: Add new templates wtfObjcMsgSend and wtfCallIMP that do the appropriate casts to correctly typed function pointers before calling objc_msgSend and IMP methods directly. * wtf/Functional.h: (WTF::R): Use wtfObjcMsgSend. * wtf/ObjcRuntimeExtras.h: Added. (wtfObjcMsgSend): (wtfCallIMP): Tools: Use wtfObjcMsgSend and wtfCallIMP templates which do appropriate casts to a function pointer with right types when calling objc_msgSend and an IMP method directly. * DumpRenderTree/mac/DumpRenderTree.mm: (drt_NSFontManager_availableFontFamilies): * WebKitTestRunner/InjectedBundle/mac/ActivateFonts.mm: (WTR::wtr_NSFontManager_availableFontFamilies): Canonical link: https://commits.webkit.org/113364@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@127193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-08-30 21:40:39 +00:00
*
* 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.
*/
Use pragma once in WTF https://bugs.webkit.org/show_bug.cgi?id=190527 Reviewed by Chris Dumez. Source/WTF: We also need to consistently include wtf headers from within wtf so we can build wtf without symbol redefinition errors from including the copy in Source and the copy in the build directory. * wtf/ASCIICType.h: * wtf/Assertions.cpp: * wtf/Assertions.h: * wtf/Atomics.h: * wtf/AutomaticThread.cpp: * wtf/AutomaticThread.h: * wtf/BackwardsGraph.h: * wtf/Bag.h: * wtf/BagToHashMap.h: * wtf/BitVector.cpp: * wtf/BitVector.h: * wtf/Bitmap.h: * wtf/BloomFilter.h: * wtf/Box.h: * wtf/BubbleSort.h: * wtf/BumpPointerAllocator.h: * wtf/ByteOrder.h: * wtf/CPUTime.cpp: * wtf/CallbackAggregator.h: * wtf/CheckedArithmetic.h: * wtf/CheckedBoolean.h: * wtf/ClockType.cpp: * wtf/ClockType.h: * wtf/CommaPrinter.h: * wtf/CompilationThread.cpp: * wtf/CompilationThread.h: * wtf/Compiler.h: * wtf/ConcurrentPtrHashSet.cpp: * wtf/ConcurrentVector.h: * wtf/Condition.h: * wtf/CountingLock.cpp: * wtf/CrossThreadTaskHandler.cpp: * wtf/CryptographicUtilities.cpp: * wtf/CryptographicUtilities.h: * wtf/CryptographicallyRandomNumber.cpp: * wtf/CryptographicallyRandomNumber.h: * wtf/CurrentTime.cpp: * wtf/DataLog.cpp: * wtf/DataLog.h: * wtf/DateMath.cpp: * wtf/DateMath.h: * wtf/DecimalNumber.cpp: * wtf/DecimalNumber.h: * wtf/Deque.h: * wtf/DisallowCType.h: * wtf/Dominators.h: * wtf/DoublyLinkedList.h: * wtf/FastBitVector.cpp: * wtf/FastMalloc.cpp: * wtf/FastMalloc.h: * wtf/FeatureDefines.h: * wtf/FilePrintStream.cpp: * wtf/FilePrintStream.h: * wtf/FlipBytes.h: * wtf/FunctionDispatcher.cpp: * wtf/FunctionDispatcher.h: * wtf/GetPtr.h: * wtf/Gigacage.cpp: * wtf/GlobalVersion.cpp: * wtf/GraphNodeWorklist.h: * wtf/GregorianDateTime.cpp: * wtf/GregorianDateTime.h: * wtf/HashFunctions.h: * wtf/HashMap.h: * wtf/HashMethod.h: * wtf/HashSet.h: * wtf/HashTable.cpp: * wtf/HashTraits.h: * wtf/Indenter.h: * wtf/IndexSparseSet.h: * wtf/InlineASM.h: * wtf/Insertion.h: * wtf/IteratorAdaptors.h: * wtf/IteratorRange.h: * wtf/JSONValues.cpp: * wtf/JSValueMalloc.cpp: * wtf/LEBDecoder.h: * wtf/Language.cpp: * wtf/ListDump.h: * wtf/Lock.cpp: * wtf/Lock.h: * wtf/LockAlgorithm.h: * wtf/LockedPrintStream.cpp: * wtf/Locker.h: * wtf/MD5.cpp: * wtf/MD5.h: * wtf/MainThread.cpp: * wtf/MainThread.h: * wtf/MallocPtr.h: * wtf/MathExtras.h: * wtf/MediaTime.cpp: * wtf/MediaTime.h: * wtf/MemoryPressureHandler.cpp: * wtf/MessageQueue.h: * wtf/MetaAllocator.cpp: * wtf/MetaAllocator.h: * wtf/MetaAllocatorHandle.h: * wtf/MonotonicTime.cpp: * wtf/MonotonicTime.h: * wtf/NakedPtr.h: * wtf/NoLock.h: * wtf/NoTailCalls.h: * wtf/Noncopyable.h: * wtf/NumberOfCores.cpp: * wtf/NumberOfCores.h: * wtf/OSAllocator.h: * wtf/OSAllocatorPosix.cpp: * wtf/OSRandomSource.cpp: * wtf/OSRandomSource.h: * wtf/ObjcRuntimeExtras.h: * wtf/OrderMaker.h: * wtf/PackedIntVector.h: * wtf/PageAllocation.h: * wtf/PageBlock.cpp: * wtf/PageBlock.h: * wtf/PageReservation.h: * wtf/ParallelHelperPool.cpp: * wtf/ParallelHelperPool.h: * wtf/ParallelJobs.h: * wtf/ParallelJobsLibdispatch.h: * wtf/ParallelVectorIterator.h: * wtf/ParkingLot.cpp: * wtf/ParkingLot.h: * wtf/Platform.h: * wtf/PointerComparison.h: * wtf/Poisoned.cpp: * wtf/PrintStream.cpp: * wtf/PrintStream.h: * wtf/ProcessID.h: * wtf/ProcessPrivilege.cpp: * wtf/RAMSize.cpp: * wtf/RAMSize.h: * wtf/RandomDevice.cpp: * wtf/RandomNumber.cpp: * wtf/RandomNumber.h: * wtf/RandomNumberSeed.h: * wtf/RangeSet.h: * wtf/RawPointer.h: * wtf/ReadWriteLock.cpp: * wtf/RedBlackTree.h: * wtf/Ref.h: * wtf/RefCountedArray.h: * wtf/RefCountedLeakCounter.cpp: * wtf/RefCountedLeakCounter.h: * wtf/RefCounter.h: * wtf/RefPtr.h: * wtf/RetainPtr.h: * wtf/RunLoop.cpp: * wtf/RunLoop.h: * wtf/RunLoopTimer.h: * wtf/RunLoopTimerCF.cpp: * wtf/SHA1.cpp: * wtf/SHA1.h: * wtf/SaturatedArithmetic.h: (saturatedSubtraction): * wtf/SchedulePair.h: * wtf/SchedulePairCF.cpp: * wtf/SchedulePairMac.mm: * wtf/ScopedLambda.h: * wtf/Seconds.cpp: * wtf/Seconds.h: * wtf/SegmentedVector.h: * wtf/SentinelLinkedList.h: * wtf/SharedTask.h: * wtf/SimpleStats.h: * wtf/SingleRootGraph.h: * wtf/SinglyLinkedList.h: * wtf/SixCharacterHash.cpp: * wtf/SixCharacterHash.h: * wtf/SmallPtrSet.h: * wtf/Spectrum.h: * wtf/StackBounds.cpp: * wtf/StackBounds.h: * wtf/StackStats.cpp: * wtf/StackStats.h: * wtf/StackTrace.cpp: * wtf/StdLibExtras.h: * wtf/StreamBuffer.h: * wtf/StringHashDumpContext.h: * wtf/StringPrintStream.cpp: * wtf/StringPrintStream.h: * wtf/ThreadGroup.cpp: * wtf/ThreadMessage.cpp: * wtf/ThreadSpecific.h: * wtf/Threading.cpp: * wtf/Threading.h: * wtf/ThreadingPrimitives.h: * wtf/ThreadingPthreads.cpp: * wtf/TimeWithDynamicClockType.cpp: * wtf/TimeWithDynamicClockType.h: * wtf/TimingScope.cpp: * wtf/TinyLRUCache.h: * wtf/TinyPtrSet.h: * wtf/TriState.h: * wtf/TypeCasts.h: * wtf/UUID.cpp: * wtf/UnionFind.h: * wtf/VMTags.h: * wtf/ValueCheck.h: * wtf/Vector.h: * wtf/VectorTraits.h: * wtf/WallTime.cpp: * wtf/WallTime.h: * wtf/WeakPtr.h: * wtf/WeakRandom.h: * wtf/WordLock.cpp: * wtf/WordLock.h: * wtf/WorkQueue.cpp: * wtf/WorkQueue.h: * wtf/WorkerPool.cpp: * wtf/cf/LanguageCF.cpp: * wtf/cf/RunLoopCF.cpp: * wtf/cocoa/Entitlements.mm: * wtf/cocoa/MachSendRight.cpp: * wtf/cocoa/MainThreadCocoa.mm: * wtf/cocoa/MemoryFootprintCocoa.cpp: * wtf/cocoa/WorkQueueCocoa.cpp: * wtf/dtoa.cpp: * wtf/dtoa.h: * wtf/ios/WebCoreThread.cpp: * wtf/ios/WebCoreThread.h: * wtf/mac/AppKitCompatibilityDeclarations.h: * wtf/mac/DeprecatedSymbolsUsedBySafari.mm: * wtf/mbmalloc.cpp: * wtf/persistence/PersistentCoders.cpp: * wtf/persistence/PersistentDecoder.cpp: * wtf/persistence/PersistentEncoder.cpp: * wtf/spi/cf/CFBundleSPI.h: * wtf/spi/darwin/CommonCryptoSPI.h: * wtf/text/ASCIIFastPath.h: * wtf/text/ASCIILiteral.cpp: * wtf/text/AtomicString.cpp: * wtf/text/AtomicString.h: * wtf/text/AtomicStringHash.h: * wtf/text/AtomicStringImpl.cpp: * wtf/text/AtomicStringImpl.h: * wtf/text/AtomicStringTable.cpp: * wtf/text/AtomicStringTable.h: * wtf/text/Base64.cpp: * wtf/text/CString.cpp: * wtf/text/CString.h: * wtf/text/ConversionMode.h: * wtf/text/ExternalStringImpl.cpp: * wtf/text/IntegerToStringConversion.h: * wtf/text/LChar.h: * wtf/text/LineEnding.cpp: * wtf/text/StringBuffer.h: * wtf/text/StringBuilder.cpp: * wtf/text/StringBuilder.h: * wtf/text/StringBuilderJSON.cpp: * wtf/text/StringCommon.h: * wtf/text/StringConcatenate.h: * wtf/text/StringHash.h: * wtf/text/StringImpl.cpp: * wtf/text/StringImpl.h: * wtf/text/StringOperators.h: * wtf/text/StringView.cpp: * wtf/text/StringView.h: * wtf/text/SymbolImpl.cpp: * wtf/text/SymbolRegistry.cpp: * wtf/text/SymbolRegistry.h: * wtf/text/TextBreakIterator.cpp: * wtf/text/TextBreakIterator.h: * wtf/text/TextBreakIteratorInternalICU.h: * wtf/text/TextPosition.h: * wtf/text/TextStream.cpp: * wtf/text/UniquedStringImpl.h: * wtf/text/WTFString.cpp: * wtf/text/WTFString.h: * wtf/text/cocoa/StringCocoa.mm: * wtf/text/cocoa/StringViewCocoa.mm: * wtf/text/cocoa/TextBreakIteratorInternalICUCocoa.cpp: * wtf/text/icu/UTextProvider.cpp: * wtf/text/icu/UTextProvider.h: * wtf/text/icu/UTextProviderLatin1.cpp: * wtf/text/icu/UTextProviderLatin1.h: * wtf/text/icu/UTextProviderUTF16.cpp: * wtf/text/icu/UTextProviderUTF16.h: * wtf/threads/BinarySemaphore.cpp: * wtf/threads/BinarySemaphore.h: * wtf/threads/Signals.cpp: * wtf/unicode/CharacterNames.h: * wtf/unicode/Collator.h: * wtf/unicode/CollatorDefault.cpp: * wtf/unicode/UTF8.cpp: * wtf/unicode/UTF8.h: Tools: Put WorkQueue in namespace DRT so it does not conflict with WTF::WorkQueue. * DumpRenderTree/TestRunner.cpp: (TestRunner::queueLoadHTMLString): (TestRunner::queueLoadAlternateHTMLString): (TestRunner::queueBackNavigation): (TestRunner::queueForwardNavigation): (TestRunner::queueLoadingScript): (TestRunner::queueNonLoadingScript): (TestRunner::queueReload): * DumpRenderTree/WorkQueue.cpp: (WorkQueue::singleton): Deleted. (WorkQueue::WorkQueue): Deleted. (WorkQueue::queue): Deleted. (WorkQueue::dequeue): Deleted. (WorkQueue::count): Deleted. (WorkQueue::clear): Deleted. (WorkQueue::processWork): Deleted. * DumpRenderTree/WorkQueue.h: (WorkQueue::setFrozen): Deleted. * DumpRenderTree/WorkQueueItem.h: * DumpRenderTree/mac/DumpRenderTree.mm: (runTest): * DumpRenderTree/mac/FrameLoadDelegate.mm: (-[FrameLoadDelegate processWork:]): (-[FrameLoadDelegate webView:locationChangeDone:forDataSource:]): * DumpRenderTree/mac/TestRunnerMac.mm: (TestRunner::notifyDone): (TestRunner::forceImmediateCompletion): (TestRunner::queueLoad): * DumpRenderTree/win/DumpRenderTree.cpp: (runTest): * DumpRenderTree/win/FrameLoadDelegate.cpp: (FrameLoadDelegate::processWork): (FrameLoadDelegate::locationChangeDone): * DumpRenderTree/win/TestRunnerWin.cpp: (TestRunner::notifyDone): (TestRunner::forceImmediateCompletion): (TestRunner::queueLoad): Canonical link: https://commits.webkit.org/205473@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237099 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-15 14:24:49 +00:00
#pragma once
objc_msgSend and IMP should be cast appropriately before using https://bugs.webkit.org/show_bug.cgi?id=95242 Reviewed by Benjamin Poulain. Source/WebCore: Use wtfObjcMsgSend and wtfCallIMP templates which do appropriate casts to a function pointer with right types when calling objc_msgSend and an IMP method directly. No new tests because no functional changes. * page/mac/EventHandlerMac.mm: (WebCore::selfRetainingNSScrollViewScrollWheel): * platform/mac/WebCoreObjCExtras.mm: (deallocCallback): Source/WebKit/mac: Use wtfObjcMsgSend and wtfCallIMP templates which do appropriate casts to a function pointer with right types when calling objc_msgSend and an IMP method directly. * WebCoreSupport/WebCachedFramePlatformData.h: (WebCachedFramePlatformData::clear): * WebCoreSupport/WebDeviceOrientationClient.mm: (WebDeviceOrientationClient::getProvider): * WebView/WebDelegateImplementationCaching.mm: (CallDelegate): (CallDelegateReturningBoolean): (CallResourceLoadDelegateReturningBoolean): (CallFormDelegate): (CallFormDelegateReturningBoolean): * WebView/WebHTMLView.mm: (setCursor): (setNeedsDisplayInRect): Source/WebKit2: Use wtfObjcMsgSend and wtfCallIMP templates which do appropriate casts to a function pointer with right types when calling objc_msgSend and an IMP method directly. * UIProcess/API/mac/PDFViewController.mm: (WebKit::PDFViewScrollView_scrollWheel): Source/WTF: Add new templates wtfObjcMsgSend and wtfCallIMP that do the appropriate casts to correctly typed function pointers before calling objc_msgSend and IMP methods directly. * wtf/Functional.h: (WTF::R): Use wtfObjcMsgSend. * wtf/ObjcRuntimeExtras.h: Added. (wtfObjcMsgSend): (wtfCallIMP): Tools: Use wtfObjcMsgSend and wtfCallIMP templates which do appropriate casts to a function pointer with right types when calling objc_msgSend and an IMP method directly. * DumpRenderTree/mac/DumpRenderTree.mm: (drt_NSFontManager_availableFontFamilies): * WebKitTestRunner/InjectedBundle/mac/ActivateFonts.mm: (WTR::wtr_NSFontManager_availableFontFamilies): Canonical link: https://commits.webkit.org/113364@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@127193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-08-30 21:40:39 +00:00
objc/objc-runtime.h does not exist on all PLATFORM(MAC) https://bugs.webkit.org/show_bug.cgi?id=101780 Reviewed by Brent Fulgham. Clean up header includes so we don't include objc/objc-runtime.h. Source/WebCore: No new tests because no functional changes. * bridge/objc/objc_header.h: * page/mac/EventHandlerMac.mm: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm: * platform/graphics/ca/mac/PlatformCALayerMac.mm: * platform/graphics/mac/MediaPlayerPrivateQTKit.mm: * platform/graphics/mac/WebLayer.mm: * platform/mac/WebCoreObjCExtras.mm: * platform/mac/WebVideoFullscreenController.mm: Source/WebKit/mac: * Carbon/HIWebView.mm: (UpdateCommandStatus): Use wtfObjcMsgSend template instead of objc_msgSend. * Plugins/WebNetscapePluginView.mm: * Plugins/WebPluginContainerCheck.mm: (-[WebPluginContainerCheck _continueWithPolicy:]): Use wtfObjcMsgSend template instead of objc_msgSend. * Plugins/WebPluginController.mm: * WebCoreSupport/WebCachedFramePlatformData.h: * WebCoreSupport/WebDeviceOrientationClient.mm: * WebView/WebDelegateImplementationCaching.mm: * WebView/WebHTMLView.mm: * WebView/WebPDFDocumentExtras.mm: * WebView/WebPolicyDelegate.mm: (-[WebPolicyDecisionListener _usePolicy:]): Use wtfObjcMsgSend template instead of objc_msgSend. * WebView/WebView.mm: Source/WebKit2: * PluginProcess/mac/PluginProcessShim.mm: * UIProcess/API/mac/PDFViewController.mm: Source/WTF: * wtf/Functional.h: * wtf/ObjcRuntimeExtras.h: Include objc/message.h here so we don't rely on proper ordering of includes in files that include this header. Tools: * DumpRenderTree/mac/DumpRenderTree.mm: * DumpRenderTree/mac/ObjCPlugin.m: * TestWebKitAPI/mac/InstanceMethodSwizzler.h: * WebKitTestRunner/InjectedBundle/mac/ActivateFonts.mm: Canonical link: https://commits.webkit.org/121528@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@135882 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-11-27 18:58:42 +00:00
#include <objc/message.h>
Fix issues found by the Clang Static Analyzer https://bugs.webkit.org/show_bug.cgi?id=120230 Reviewed by Darin Adler. Source/JavaScriptCore: * API/JSValue.mm: (valueToString): Don't leak every CFStringRef when in Objective-C GC. * API/ObjCCallbackFunction.mm: (JSC::ObjCCallbackFunctionImpl::~ObjCCallbackFunctionImpl): Don't release m_invocation's target since NSInvocation will do it for us on -dealloc. (objCCallbackFunctionForBlock): Tell NSInvocation to retain its target and -release our reference to the copied block. * API/tests/minidom.c: (createStringWithContentsOfFile): Free buffer before returning. * API/tests/testapi.c: (createStringWithContentsOfFile): Ditto. Source/WebCore: * WebCore.xcodeproj/project.pbxproj: Removed FoundationExtras.h. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: Removed CFAutoreleaseHelper(). (AXTextMarkerRange): Used HardAutorelease() instead of CFAutoreleaseHelper(). (AXTextMarkerRangeStart): Ditto. (AXTextMarkerRangeEnd): Ditto. (textMarkerForVisiblePosition): Ditto. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (-[WebCoreAVFMovieObserver initWithCallback:]): Called [super init] first so that we don't later use ivars from the wrong self. (-[WebCoreAVFLoaderDelegate initWithCallback:]): Ditto. * platform/mac/FoundationExtras.h: Removed. * platform/mac/KURLMac.mm: (WebCore::KURL::operator NSURL *): Used WTF's HardAutorelease(). * platform/mac/WebCoreNSURLExtras.mm: (WebCore::mapHostNameWithRange): Used HardAutorelease() instead of WebCoreCFAutorelease(). (WebCore::URLWithData): Ditto. (WebCore::userVisibleString): Ditto. (WebCore::URLByRemovingComponentAndSubsequentCharacter): Used Vector<> with an inline capacity rather than heap-allocating a buffer. * platform/mac/WebCoreObjCExtras.h: Used HardAutorelease() instead of WebCoreCFAutorelease(). * platform/text/mac/StringImplMac.mm: (WTF::StringImpl::operator NSString *): Used WTF's HardAutorelease(). Source/WebKit/mac: * Misc/WebNSFileManagerExtras.mm: (-[NSFileManager _webkit_startupVolumeName]): Used HardAutorelease() instead of WebCFAutorelease(). * Misc/WebNSObjectExtras.h: Removed definition of WebCFAutorelease(). * Misc/WebNSURLExtras.mm: (-[NSURL _web_URLWithLowercasedScheme]): Used HardAutorelease() instead of WebCFAutorelease(). * Plugins/Hosted/WebHostedNetscapePluginView.mm: (-[WebHostedNetscapePluginView createPluginLayer]): Stop leaking CGColors (CALayer retains its backgroundColor property despite the property attributes claiming otherwise). * Plugins/WebBasePluginPackage.mm: (+[WebBasePluginPackage preferredLocalizationName]): Used HardAutorelease() instead of WebCFAutorelease(). * WebView/WebDeviceOrientationProviderMock.mm: (-[WebDeviceOrientationProviderMockInternal lastOrientation]): Stop leaking WebDeviceOrientations. * WebView/WebPDFRepresentation.mm: (-[WebPDFRepresentation convertPostScriptDataSourceToPDF:]): Used HardAutorelease() instead of WebCFAutorelease(). * WebView/WebView.mm: (+[WebView _setCacheModel:]): Ditto. (-[WebView _removeObjectForIdentifier:]): Ditto. Source/WebKit2: * UIProcess/API/mac/WKBrowsingContextController.mm: (autoreleased): Don't leak CFURLs when in Objective-C GC. * WebProcess/WebPage/mac/WKAccessibilityWebPageObject.mm: (-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]): Don't leak CFStrings when in Objective-C GC. Source/WTF: * wtf/ObjcRuntimeExtras.h: (HardAutorelease): Added a canonical implementation of HardAutorelease. Tools: * DumpRenderTree/mac/DumpRenderTreePasteboard.m: (-[LocalPasteboard initWithName:]): Called [super init] first so that we don't later use ivars from the wrong self. * DumpRenderTree/mac/TestRunnerMac.mm: (-[APITestDelegate initWithCompletionCondition:]): Ditto. * TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsTest.mm: (TestWebKitAPI::TEST): Don't leak WKProcessGroups, WKBrowsingContextGroups, and WKViews. Canonical link: https://commits.webkit.org/138298@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-08-26 22:40:55 +00:00
#ifdef __cplusplus
objc_msgSend and IMP should be cast appropriately before using https://bugs.webkit.org/show_bug.cgi?id=95242 Reviewed by Benjamin Poulain. Source/WebCore: Use wtfObjcMsgSend and wtfCallIMP templates which do appropriate casts to a function pointer with right types when calling objc_msgSend and an IMP method directly. No new tests because no functional changes. * page/mac/EventHandlerMac.mm: (WebCore::selfRetainingNSScrollViewScrollWheel): * platform/mac/WebCoreObjCExtras.mm: (deallocCallback): Source/WebKit/mac: Use wtfObjcMsgSend and wtfCallIMP templates which do appropriate casts to a function pointer with right types when calling objc_msgSend and an IMP method directly. * WebCoreSupport/WebCachedFramePlatformData.h: (WebCachedFramePlatformData::clear): * WebCoreSupport/WebDeviceOrientationClient.mm: (WebDeviceOrientationClient::getProvider): * WebView/WebDelegateImplementationCaching.mm: (CallDelegate): (CallDelegateReturningBoolean): (CallResourceLoadDelegateReturningBoolean): (CallFormDelegate): (CallFormDelegateReturningBoolean): * WebView/WebHTMLView.mm: (setCursor): (setNeedsDisplayInRect): Source/WebKit2: Use wtfObjcMsgSend and wtfCallIMP templates which do appropriate casts to a function pointer with right types when calling objc_msgSend and an IMP method directly. * UIProcess/API/mac/PDFViewController.mm: (WebKit::PDFViewScrollView_scrollWheel): Source/WTF: Add new templates wtfObjcMsgSend and wtfCallIMP that do the appropriate casts to correctly typed function pointers before calling objc_msgSend and IMP methods directly. * wtf/Functional.h: (WTF::R): Use wtfObjcMsgSend. * wtf/ObjcRuntimeExtras.h: Added. (wtfObjcMsgSend): (wtfCallIMP): Tools: Use wtfObjcMsgSend and wtfCallIMP templates which do appropriate casts to a function pointer with right types when calling objc_msgSend and an IMP method directly. * DumpRenderTree/mac/DumpRenderTree.mm: (drt_NSFontManager_availableFontFamilies): * WebKitTestRunner/InjectedBundle/mac/ActivateFonts.mm: (WTR::wtr_NSFontManager_availableFontFamilies): Canonical link: https://commits.webkit.org/113364@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@127193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-08-30 21:40:39 +00:00
[Mac] No need for HardAutorelease, which is same as CFBridgingRelease https://bugs.webkit.org/show_bug.cgi?id=120569 Reviewed by Andy Estes. Source/JavaScriptCore: * API/JSValue.mm: (valueToString): Use CFBridgingRelease. Source/WebCore: * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (AXTextMarkerRange): (AXTextMarkerRangeStart): (AXTextMarkerRangeEnd): (textMarkerForVisiblePosition): Use CFBridgingRelease. * platform/mac/KURLMac.mm: (WebCore::KURL::operator NSURL *): Use CFBridgingRelease. (WebCore::KURL::createCFURL): Get rid of needless local variable. * platform/mac/WebCoreNSURLExtras.mm: (WebCore::mapHostNameWithRange): (WebCore::URLWithData): (WebCore::userVisibleString): * platform/text/mac/StringImplMac.mm: (WTF::StringImpl::operator NSString *): Use CFBridgingRelease. Source/WebKit/mac: * Misc/WebNSFileManagerExtras.mm: (-[NSFileManager _webkit_startupVolumeName]): Removed some unneeded locals. Got rid of the pointless ref/leakRef/HardAutorelease dance, and replaced it with a [[x copy] autorelease]. * Misc/WebNSURLExtras.mm: (-[NSURL _web_URLWithLowercasedScheme]): Use CFBridgingRelease, and got rid of unneeded type casts. * Plugins/WebBasePluginPackage.mm: (+[WebBasePluginPackage preferredLocalizationName]): Use CFBridgingRelease. * WebView/WebPDFRepresentation.mm: (-[WebPDFRepresentation convertPostScriptDataSourceToPDF:]): Ditto. * WebView/WebView.mm: (+[WebView _setCacheModel:]): Use CFBridgingRelease and got rid of unneeded type cast. Source/WebKit2: * Platform/mac/StringUtilities.mm: (WebKit::nsStringFromWebCoreString): Use CFBridgingRelease. Also changed condition to be a little cleaner and use a constant string for empty strings as well as null strings. * UIProcess/API/mac/WKBrowsingContextController.mm: (autoreleased): Switched from autorelease to CFBridgingRelease for strings, which eliminates a type cast and makes this work under GC, although I don't think we should compile WebKit2 for GC. * WebProcess/WebPage/mac/WKAccessibilityWebPageObject.mm: (-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]): Use CFBridgingRelease. Source/WTF: * wtf/ObjcRuntimeExtras.h: Added a FIXME about miscapitalization of ObjC. Deleted HardAutorelease. (wtfObjcMsgSend): Dropped the use of abbreviations in local class and argument names. (wtfCallIMP): Ditto. Tools: * DumpRenderTree/mac/DumpRenderTree.mm: (dump): Use CFBridgingRelease. Canonical link: https://commits.webkit.org/138589@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154963 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-09-02 18:55:05 +00:00
template<typename ReturnType, typename... ArgumentTypes>
Fix a fixme: rename wtfObjcMsgSend to wtfObjCMsgSend https://bugs.webkit.org/show_bug.cgi?id=191492 Reviewed by Alex Christensen. Source/JavaScriptCore: * API/JSValue.mm: Source/WebCore: * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: * page/mac/EventHandlerMac.mm: * platform/mac/URLMac.mm: * platform/mac/WebCoreNSURLExtras.mm: * platform/mac/WebCoreObjCExtras.mm: * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::systemColor const): Source/WebKit: * Platform/mac/StringUtilities.mm: * UIProcess/ApplicationStateTracker.mm: (WebKit::ApplicationStateTracker::applicationDidEnterBackground): (WebKit::ApplicationStateTracker::applicationDidFinishSnapshottingAfterEnteringBackground): (WebKit::ApplicationStateTracker::applicationWillEnterForeground): * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm: * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm: Source/WebKitLegacy/mac: * Carbon/HIWebView.mm: (UpdateCommandStatus): * Misc/WebNSFileManagerExtras.mm: * Misc/WebNSURLExtras.mm: * Plugins/Hosted/WebHostedNetscapePluginView.mm: * Plugins/WebBasePluginPackage.mm: * Plugins/WebPluginContainerCheck.mm: (-[WebPluginContainerCheck _continueWithPolicy:]): * WebCoreSupport/WebCachedFramePlatformData.h: (WebCachedFramePlatformData::clear): * WebCoreSupport/WebDeviceOrientationClient.mm: (WebDeviceOrientationClient::getProvider const): * WebView/WebDelegateImplementationCaching.mm: (CallDelegate): (CallDelegateReturningBoolean): (CallResourceLoadDelegateReturningBoolean): (CallFormDelegate): (CallFormDelegateReturningBoolean): * WebView/WebHTMLView.mm: * WebView/WebPDFRepresentation.mm: * WebView/WebPolicyDelegate.mm: (-[WebPolicyDecisionListener _usePolicy:]): * WebView/WebView.mm: Source/WTF: Because renaming ObjcRuntimeExtras.h to ObjCRuntimeExtras.h only changes the cases, some systems have issues with applying this patch. To work around the problem, the change is made is two patches, first rename to WTFObjCRuntimeExtras.h, then back to ObjCRuntimeExtras.h. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/WTFObjCRuntimeExtras.h: Renamed from Source/WTF/wtf/ObjcRuntimeExtras.h. (wtfObjCMsgSend): Tools: * DumpRenderTree/mac/DumpRenderTree.mm: * WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm: * WebKitTestRunner/mac/TestControllerMac.mm: Canonical link: https://commits.webkit.org/206287@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238073 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-11-11 06:16:22 +00:00
inline ReturnType wtfObjCMsgSend(id target, SEL selector, ArgumentTypes... arguments)
objc_msgSend and IMP should be cast appropriately before using https://bugs.webkit.org/show_bug.cgi?id=95242 Reviewed by Benjamin Poulain. Source/WebCore: Use wtfObjcMsgSend and wtfCallIMP templates which do appropriate casts to a function pointer with right types when calling objc_msgSend and an IMP method directly. No new tests because no functional changes. * page/mac/EventHandlerMac.mm: (WebCore::selfRetainingNSScrollViewScrollWheel): * platform/mac/WebCoreObjCExtras.mm: (deallocCallback): Source/WebKit/mac: Use wtfObjcMsgSend and wtfCallIMP templates which do appropriate casts to a function pointer with right types when calling objc_msgSend and an IMP method directly. * WebCoreSupport/WebCachedFramePlatformData.h: (WebCachedFramePlatformData::clear): * WebCoreSupport/WebDeviceOrientationClient.mm: (WebDeviceOrientationClient::getProvider): * WebView/WebDelegateImplementationCaching.mm: (CallDelegate): (CallDelegateReturningBoolean): (CallResourceLoadDelegateReturningBoolean): (CallFormDelegate): (CallFormDelegateReturningBoolean): * WebView/WebHTMLView.mm: (setCursor): (setNeedsDisplayInRect): Source/WebKit2: Use wtfObjcMsgSend and wtfCallIMP templates which do appropriate casts to a function pointer with right types when calling objc_msgSend and an IMP method directly. * UIProcess/API/mac/PDFViewController.mm: (WebKit::PDFViewScrollView_scrollWheel): Source/WTF: Add new templates wtfObjcMsgSend and wtfCallIMP that do the appropriate casts to correctly typed function pointers before calling objc_msgSend and IMP methods directly. * wtf/Functional.h: (WTF::R): Use wtfObjcMsgSend. * wtf/ObjcRuntimeExtras.h: Added. (wtfObjcMsgSend): (wtfCallIMP): Tools: Use wtfObjcMsgSend and wtfCallIMP templates which do appropriate casts to a function pointer with right types when calling objc_msgSend and an IMP method directly. * DumpRenderTree/mac/DumpRenderTree.mm: (drt_NSFontManager_availableFontFamilies): * WebKitTestRunner/InjectedBundle/mac/ActivateFonts.mm: (WTR::wtr_NSFontManager_availableFontFamilies): Canonical link: https://commits.webkit.org/113364@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@127193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-08-30 21:40:39 +00:00
{
[Mac] No need for HardAutorelease, which is same as CFBridgingRelease https://bugs.webkit.org/show_bug.cgi?id=120569 Reviewed by Andy Estes. Source/JavaScriptCore: * API/JSValue.mm: (valueToString): Use CFBridgingRelease. Source/WebCore: * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (AXTextMarkerRange): (AXTextMarkerRangeStart): (AXTextMarkerRangeEnd): (textMarkerForVisiblePosition): Use CFBridgingRelease. * platform/mac/KURLMac.mm: (WebCore::KURL::operator NSURL *): Use CFBridgingRelease. (WebCore::KURL::createCFURL): Get rid of needless local variable. * platform/mac/WebCoreNSURLExtras.mm: (WebCore::mapHostNameWithRange): (WebCore::URLWithData): (WebCore::userVisibleString): * platform/text/mac/StringImplMac.mm: (WTF::StringImpl::operator NSString *): Use CFBridgingRelease. Source/WebKit/mac: * Misc/WebNSFileManagerExtras.mm: (-[NSFileManager _webkit_startupVolumeName]): Removed some unneeded locals. Got rid of the pointless ref/leakRef/HardAutorelease dance, and replaced it with a [[x copy] autorelease]. * Misc/WebNSURLExtras.mm: (-[NSURL _web_URLWithLowercasedScheme]): Use CFBridgingRelease, and got rid of unneeded type casts. * Plugins/WebBasePluginPackage.mm: (+[WebBasePluginPackage preferredLocalizationName]): Use CFBridgingRelease. * WebView/WebPDFRepresentation.mm: (-[WebPDFRepresentation convertPostScriptDataSourceToPDF:]): Ditto. * WebView/WebView.mm: (+[WebView _setCacheModel:]): Use CFBridgingRelease and got rid of unneeded type cast. Source/WebKit2: * Platform/mac/StringUtilities.mm: (WebKit::nsStringFromWebCoreString): Use CFBridgingRelease. Also changed condition to be a little cleaner and use a constant string for empty strings as well as null strings. * UIProcess/API/mac/WKBrowsingContextController.mm: (autoreleased): Switched from autorelease to CFBridgingRelease for strings, which eliminates a type cast and makes this work under GC, although I don't think we should compile WebKit2 for GC. * WebProcess/WebPage/mac/WKAccessibilityWebPageObject.mm: (-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]): Use CFBridgingRelease. Source/WTF: * wtf/ObjcRuntimeExtras.h: Added a FIXME about miscapitalization of ObjC. Deleted HardAutorelease. (wtfObjcMsgSend): Dropped the use of abbreviations in local class and argument names. (wtfCallIMP): Ditto. Tools: * DumpRenderTree/mac/DumpRenderTree.mm: (dump): Use CFBridgingRelease. Canonical link: https://commits.webkit.org/138589@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154963 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-09-02 18:55:05 +00:00
return reinterpret_cast<ReturnType (*)(id, SEL, ArgumentTypes...)>(objc_msgSend)(target, selector, arguments...);
objc_msgSend and IMP should be cast appropriately before using https://bugs.webkit.org/show_bug.cgi?id=95242 Reviewed by Benjamin Poulain. Source/WebCore: Use wtfObjcMsgSend and wtfCallIMP templates which do appropriate casts to a function pointer with right types when calling objc_msgSend and an IMP method directly. No new tests because no functional changes. * page/mac/EventHandlerMac.mm: (WebCore::selfRetainingNSScrollViewScrollWheel): * platform/mac/WebCoreObjCExtras.mm: (deallocCallback): Source/WebKit/mac: Use wtfObjcMsgSend and wtfCallIMP templates which do appropriate casts to a function pointer with right types when calling objc_msgSend and an IMP method directly. * WebCoreSupport/WebCachedFramePlatformData.h: (WebCachedFramePlatformData::clear): * WebCoreSupport/WebDeviceOrientationClient.mm: (WebDeviceOrientationClient::getProvider): * WebView/WebDelegateImplementationCaching.mm: (CallDelegate): (CallDelegateReturningBoolean): (CallResourceLoadDelegateReturningBoolean): (CallFormDelegate): (CallFormDelegateReturningBoolean): * WebView/WebHTMLView.mm: (setCursor): (setNeedsDisplayInRect): Source/WebKit2: Use wtfObjcMsgSend and wtfCallIMP templates which do appropriate casts to a function pointer with right types when calling objc_msgSend and an IMP method directly. * UIProcess/API/mac/PDFViewController.mm: (WebKit::PDFViewScrollView_scrollWheel): Source/WTF: Add new templates wtfObjcMsgSend and wtfCallIMP that do the appropriate casts to correctly typed function pointers before calling objc_msgSend and IMP methods directly. * wtf/Functional.h: (WTF::R): Use wtfObjcMsgSend. * wtf/ObjcRuntimeExtras.h: Added. (wtfObjcMsgSend): (wtfCallIMP): Tools: Use wtfObjcMsgSend and wtfCallIMP templates which do appropriate casts to a function pointer with right types when calling objc_msgSend and an IMP method directly. * DumpRenderTree/mac/DumpRenderTree.mm: (drt_NSFontManager_availableFontFamilies): * WebKitTestRunner/InjectedBundle/mac/ActivateFonts.mm: (WTR::wtr_NSFontManager_availableFontFamilies): Canonical link: https://commits.webkit.org/113364@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@127193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-08-30 21:40:39 +00:00
}
Fix issues found by the Clang Static Analyzer https://bugs.webkit.org/show_bug.cgi?id=120230 Reviewed by Darin Adler. Source/JavaScriptCore: * API/JSValue.mm: (valueToString): Don't leak every CFStringRef when in Objective-C GC. * API/ObjCCallbackFunction.mm: (JSC::ObjCCallbackFunctionImpl::~ObjCCallbackFunctionImpl): Don't release m_invocation's target since NSInvocation will do it for us on -dealloc. (objCCallbackFunctionForBlock): Tell NSInvocation to retain its target and -release our reference to the copied block. * API/tests/minidom.c: (createStringWithContentsOfFile): Free buffer before returning. * API/tests/testapi.c: (createStringWithContentsOfFile): Ditto. Source/WebCore: * WebCore.xcodeproj/project.pbxproj: Removed FoundationExtras.h. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: Removed CFAutoreleaseHelper(). (AXTextMarkerRange): Used HardAutorelease() instead of CFAutoreleaseHelper(). (AXTextMarkerRangeStart): Ditto. (AXTextMarkerRangeEnd): Ditto. (textMarkerForVisiblePosition): Ditto. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (-[WebCoreAVFMovieObserver initWithCallback:]): Called [super init] first so that we don't later use ivars from the wrong self. (-[WebCoreAVFLoaderDelegate initWithCallback:]): Ditto. * platform/mac/FoundationExtras.h: Removed. * platform/mac/KURLMac.mm: (WebCore::KURL::operator NSURL *): Used WTF's HardAutorelease(). * platform/mac/WebCoreNSURLExtras.mm: (WebCore::mapHostNameWithRange): Used HardAutorelease() instead of WebCoreCFAutorelease(). (WebCore::URLWithData): Ditto. (WebCore::userVisibleString): Ditto. (WebCore::URLByRemovingComponentAndSubsequentCharacter): Used Vector<> with an inline capacity rather than heap-allocating a buffer. * platform/mac/WebCoreObjCExtras.h: Used HardAutorelease() instead of WebCoreCFAutorelease(). * platform/text/mac/StringImplMac.mm: (WTF::StringImpl::operator NSString *): Used WTF's HardAutorelease(). Source/WebKit/mac: * Misc/WebNSFileManagerExtras.mm: (-[NSFileManager _webkit_startupVolumeName]): Used HardAutorelease() instead of WebCFAutorelease(). * Misc/WebNSObjectExtras.h: Removed definition of WebCFAutorelease(). * Misc/WebNSURLExtras.mm: (-[NSURL _web_URLWithLowercasedScheme]): Used HardAutorelease() instead of WebCFAutorelease(). * Plugins/Hosted/WebHostedNetscapePluginView.mm: (-[WebHostedNetscapePluginView createPluginLayer]): Stop leaking CGColors (CALayer retains its backgroundColor property despite the property attributes claiming otherwise). * Plugins/WebBasePluginPackage.mm: (+[WebBasePluginPackage preferredLocalizationName]): Used HardAutorelease() instead of WebCFAutorelease(). * WebView/WebDeviceOrientationProviderMock.mm: (-[WebDeviceOrientationProviderMockInternal lastOrientation]): Stop leaking WebDeviceOrientations. * WebView/WebPDFRepresentation.mm: (-[WebPDFRepresentation convertPostScriptDataSourceToPDF:]): Used HardAutorelease() instead of WebCFAutorelease(). * WebView/WebView.mm: (+[WebView _setCacheModel:]): Ditto. (-[WebView _removeObjectForIdentifier:]): Ditto. Source/WebKit2: * UIProcess/API/mac/WKBrowsingContextController.mm: (autoreleased): Don't leak CFURLs when in Objective-C GC. * WebProcess/WebPage/mac/WKAccessibilityWebPageObject.mm: (-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]): Don't leak CFStrings when in Objective-C GC. Source/WTF: * wtf/ObjcRuntimeExtras.h: (HardAutorelease): Added a canonical implementation of HardAutorelease. Tools: * DumpRenderTree/mac/DumpRenderTreePasteboard.m: (-[LocalPasteboard initWithName:]): Called [super init] first so that we don't later use ivars from the wrong self. * DumpRenderTree/mac/TestRunnerMac.mm: (-[APITestDelegate initWithCompletionCondition:]): Ditto. * TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsTest.mm: (TestWebKitAPI::TEST): Don't leak WKProcessGroups, WKBrowsingContextGroups, and WKViews. Canonical link: https://commits.webkit.org/138298@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-08-26 22:40:55 +00:00
[Mac] No need for HardAutorelease, which is same as CFBridgingRelease https://bugs.webkit.org/show_bug.cgi?id=120569 Reviewed by Andy Estes. Source/JavaScriptCore: * API/JSValue.mm: (valueToString): Use CFBridgingRelease. Source/WebCore: * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (AXTextMarkerRange): (AXTextMarkerRangeStart): (AXTextMarkerRangeEnd): (textMarkerForVisiblePosition): Use CFBridgingRelease. * platform/mac/KURLMac.mm: (WebCore::KURL::operator NSURL *): Use CFBridgingRelease. (WebCore::KURL::createCFURL): Get rid of needless local variable. * platform/mac/WebCoreNSURLExtras.mm: (WebCore::mapHostNameWithRange): (WebCore::URLWithData): (WebCore::userVisibleString): * platform/text/mac/StringImplMac.mm: (WTF::StringImpl::operator NSString *): Use CFBridgingRelease. Source/WebKit/mac: * Misc/WebNSFileManagerExtras.mm: (-[NSFileManager _webkit_startupVolumeName]): Removed some unneeded locals. Got rid of the pointless ref/leakRef/HardAutorelease dance, and replaced it with a [[x copy] autorelease]. * Misc/WebNSURLExtras.mm: (-[NSURL _web_URLWithLowercasedScheme]): Use CFBridgingRelease, and got rid of unneeded type casts. * Plugins/WebBasePluginPackage.mm: (+[WebBasePluginPackage preferredLocalizationName]): Use CFBridgingRelease. * WebView/WebPDFRepresentation.mm: (-[WebPDFRepresentation convertPostScriptDataSourceToPDF:]): Ditto. * WebView/WebView.mm: (+[WebView _setCacheModel:]): Use CFBridgingRelease and got rid of unneeded type cast. Source/WebKit2: * Platform/mac/StringUtilities.mm: (WebKit::nsStringFromWebCoreString): Use CFBridgingRelease. Also changed condition to be a little cleaner and use a constant string for empty strings as well as null strings. * UIProcess/API/mac/WKBrowsingContextController.mm: (autoreleased): Switched from autorelease to CFBridgingRelease for strings, which eliminates a type cast and makes this work under GC, although I don't think we should compile WebKit2 for GC. * WebProcess/WebPage/mac/WKAccessibilityWebPageObject.mm: (-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]): Use CFBridgingRelease. Source/WTF: * wtf/ObjcRuntimeExtras.h: Added a FIXME about miscapitalization of ObjC. Deleted HardAutorelease. (wtfObjcMsgSend): Dropped the use of abbreviations in local class and argument names. (wtfCallIMP): Ditto. Tools: * DumpRenderTree/mac/DumpRenderTree.mm: (dump): Use CFBridgingRelease. Canonical link: https://commits.webkit.org/138589@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154963 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-09-02 18:55:05 +00:00
template<typename ReturnType, typename... ArgumentTypes>
inline ReturnType wtfCallIMP(IMP implementation, id target, SEL selector, ArgumentTypes... arguments)
Fix issues found by the Clang Static Analyzer https://bugs.webkit.org/show_bug.cgi?id=120230 Reviewed by Darin Adler. Source/JavaScriptCore: * API/JSValue.mm: (valueToString): Don't leak every CFStringRef when in Objective-C GC. * API/ObjCCallbackFunction.mm: (JSC::ObjCCallbackFunctionImpl::~ObjCCallbackFunctionImpl): Don't release m_invocation's target since NSInvocation will do it for us on -dealloc. (objCCallbackFunctionForBlock): Tell NSInvocation to retain its target and -release our reference to the copied block. * API/tests/minidom.c: (createStringWithContentsOfFile): Free buffer before returning. * API/tests/testapi.c: (createStringWithContentsOfFile): Ditto. Source/WebCore: * WebCore.xcodeproj/project.pbxproj: Removed FoundationExtras.h. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: Removed CFAutoreleaseHelper(). (AXTextMarkerRange): Used HardAutorelease() instead of CFAutoreleaseHelper(). (AXTextMarkerRangeStart): Ditto. (AXTextMarkerRangeEnd): Ditto. (textMarkerForVisiblePosition): Ditto. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (-[WebCoreAVFMovieObserver initWithCallback:]): Called [super init] first so that we don't later use ivars from the wrong self. (-[WebCoreAVFLoaderDelegate initWithCallback:]): Ditto. * platform/mac/FoundationExtras.h: Removed. * platform/mac/KURLMac.mm: (WebCore::KURL::operator NSURL *): Used WTF's HardAutorelease(). * platform/mac/WebCoreNSURLExtras.mm: (WebCore::mapHostNameWithRange): Used HardAutorelease() instead of WebCoreCFAutorelease(). (WebCore::URLWithData): Ditto. (WebCore::userVisibleString): Ditto. (WebCore::URLByRemovingComponentAndSubsequentCharacter): Used Vector<> with an inline capacity rather than heap-allocating a buffer. * platform/mac/WebCoreObjCExtras.h: Used HardAutorelease() instead of WebCoreCFAutorelease(). * platform/text/mac/StringImplMac.mm: (WTF::StringImpl::operator NSString *): Used WTF's HardAutorelease(). Source/WebKit/mac: * Misc/WebNSFileManagerExtras.mm: (-[NSFileManager _webkit_startupVolumeName]): Used HardAutorelease() instead of WebCFAutorelease(). * Misc/WebNSObjectExtras.h: Removed definition of WebCFAutorelease(). * Misc/WebNSURLExtras.mm: (-[NSURL _web_URLWithLowercasedScheme]): Used HardAutorelease() instead of WebCFAutorelease(). * Plugins/Hosted/WebHostedNetscapePluginView.mm: (-[WebHostedNetscapePluginView createPluginLayer]): Stop leaking CGColors (CALayer retains its backgroundColor property despite the property attributes claiming otherwise). * Plugins/WebBasePluginPackage.mm: (+[WebBasePluginPackage preferredLocalizationName]): Used HardAutorelease() instead of WebCFAutorelease(). * WebView/WebDeviceOrientationProviderMock.mm: (-[WebDeviceOrientationProviderMockInternal lastOrientation]): Stop leaking WebDeviceOrientations. * WebView/WebPDFRepresentation.mm: (-[WebPDFRepresentation convertPostScriptDataSourceToPDF:]): Used HardAutorelease() instead of WebCFAutorelease(). * WebView/WebView.mm: (+[WebView _setCacheModel:]): Ditto. (-[WebView _removeObjectForIdentifier:]): Ditto. Source/WebKit2: * UIProcess/API/mac/WKBrowsingContextController.mm: (autoreleased): Don't leak CFURLs when in Objective-C GC. * WebProcess/WebPage/mac/WKAccessibilityWebPageObject.mm: (-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]): Don't leak CFStrings when in Objective-C GC. Source/WTF: * wtf/ObjcRuntimeExtras.h: (HardAutorelease): Added a canonical implementation of HardAutorelease. Tools: * DumpRenderTree/mac/DumpRenderTreePasteboard.m: (-[LocalPasteboard initWithName:]): Called [super init] first so that we don't later use ivars from the wrong self. * DumpRenderTree/mac/TestRunnerMac.mm: (-[APITestDelegate initWithCompletionCondition:]): Ditto. * TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsTest.mm: (TestWebKitAPI::TEST): Don't leak WKProcessGroups, WKBrowsingContextGroups, and WKViews. Canonical link: https://commits.webkit.org/138298@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-08-26 22:40:55 +00:00
{
[Mac] No need for HardAutorelease, which is same as CFBridgingRelease https://bugs.webkit.org/show_bug.cgi?id=120569 Reviewed by Andy Estes. Source/JavaScriptCore: * API/JSValue.mm: (valueToString): Use CFBridgingRelease. Source/WebCore: * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (AXTextMarkerRange): (AXTextMarkerRangeStart): (AXTextMarkerRangeEnd): (textMarkerForVisiblePosition): Use CFBridgingRelease. * platform/mac/KURLMac.mm: (WebCore::KURL::operator NSURL *): Use CFBridgingRelease. (WebCore::KURL::createCFURL): Get rid of needless local variable. * platform/mac/WebCoreNSURLExtras.mm: (WebCore::mapHostNameWithRange): (WebCore::URLWithData): (WebCore::userVisibleString): * platform/text/mac/StringImplMac.mm: (WTF::StringImpl::operator NSString *): Use CFBridgingRelease. Source/WebKit/mac: * Misc/WebNSFileManagerExtras.mm: (-[NSFileManager _webkit_startupVolumeName]): Removed some unneeded locals. Got rid of the pointless ref/leakRef/HardAutorelease dance, and replaced it with a [[x copy] autorelease]. * Misc/WebNSURLExtras.mm: (-[NSURL _web_URLWithLowercasedScheme]): Use CFBridgingRelease, and got rid of unneeded type casts. * Plugins/WebBasePluginPackage.mm: (+[WebBasePluginPackage preferredLocalizationName]): Use CFBridgingRelease. * WebView/WebPDFRepresentation.mm: (-[WebPDFRepresentation convertPostScriptDataSourceToPDF:]): Ditto. * WebView/WebView.mm: (+[WebView _setCacheModel:]): Use CFBridgingRelease and got rid of unneeded type cast. Source/WebKit2: * Platform/mac/StringUtilities.mm: (WebKit::nsStringFromWebCoreString): Use CFBridgingRelease. Also changed condition to be a little cleaner and use a constant string for empty strings as well as null strings. * UIProcess/API/mac/WKBrowsingContextController.mm: (autoreleased): Switched from autorelease to CFBridgingRelease for strings, which eliminates a type cast and makes this work under GC, although I don't think we should compile WebKit2 for GC. * WebProcess/WebPage/mac/WKAccessibilityWebPageObject.mm: (-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]): Use CFBridgingRelease. Source/WTF: * wtf/ObjcRuntimeExtras.h: Added a FIXME about miscapitalization of ObjC. Deleted HardAutorelease. (wtfObjcMsgSend): Dropped the use of abbreviations in local class and argument names. (wtfCallIMP): Ditto. Tools: * DumpRenderTree/mac/DumpRenderTree.mm: (dump): Use CFBridgingRelease. Canonical link: https://commits.webkit.org/138589@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154963 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-09-02 18:55:05 +00:00
return reinterpret_cast<ReturnType (*)(id, SEL, ArgumentTypes...)>(implementation)(target, selector, arguments...);
Fix issues found by the Clang Static Analyzer https://bugs.webkit.org/show_bug.cgi?id=120230 Reviewed by Darin Adler. Source/JavaScriptCore: * API/JSValue.mm: (valueToString): Don't leak every CFStringRef when in Objective-C GC. * API/ObjCCallbackFunction.mm: (JSC::ObjCCallbackFunctionImpl::~ObjCCallbackFunctionImpl): Don't release m_invocation's target since NSInvocation will do it for us on -dealloc. (objCCallbackFunctionForBlock): Tell NSInvocation to retain its target and -release our reference to the copied block. * API/tests/minidom.c: (createStringWithContentsOfFile): Free buffer before returning. * API/tests/testapi.c: (createStringWithContentsOfFile): Ditto. Source/WebCore: * WebCore.xcodeproj/project.pbxproj: Removed FoundationExtras.h. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: Removed CFAutoreleaseHelper(). (AXTextMarkerRange): Used HardAutorelease() instead of CFAutoreleaseHelper(). (AXTextMarkerRangeStart): Ditto. (AXTextMarkerRangeEnd): Ditto. (textMarkerForVisiblePosition): Ditto. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (-[WebCoreAVFMovieObserver initWithCallback:]): Called [super init] first so that we don't later use ivars from the wrong self. (-[WebCoreAVFLoaderDelegate initWithCallback:]): Ditto. * platform/mac/FoundationExtras.h: Removed. * platform/mac/KURLMac.mm: (WebCore::KURL::operator NSURL *): Used WTF's HardAutorelease(). * platform/mac/WebCoreNSURLExtras.mm: (WebCore::mapHostNameWithRange): Used HardAutorelease() instead of WebCoreCFAutorelease(). (WebCore::URLWithData): Ditto. (WebCore::userVisibleString): Ditto. (WebCore::URLByRemovingComponentAndSubsequentCharacter): Used Vector<> with an inline capacity rather than heap-allocating a buffer. * platform/mac/WebCoreObjCExtras.h: Used HardAutorelease() instead of WebCoreCFAutorelease(). * platform/text/mac/StringImplMac.mm: (WTF::StringImpl::operator NSString *): Used WTF's HardAutorelease(). Source/WebKit/mac: * Misc/WebNSFileManagerExtras.mm: (-[NSFileManager _webkit_startupVolumeName]): Used HardAutorelease() instead of WebCFAutorelease(). * Misc/WebNSObjectExtras.h: Removed definition of WebCFAutorelease(). * Misc/WebNSURLExtras.mm: (-[NSURL _web_URLWithLowercasedScheme]): Used HardAutorelease() instead of WebCFAutorelease(). * Plugins/Hosted/WebHostedNetscapePluginView.mm: (-[WebHostedNetscapePluginView createPluginLayer]): Stop leaking CGColors (CALayer retains its backgroundColor property despite the property attributes claiming otherwise). * Plugins/WebBasePluginPackage.mm: (+[WebBasePluginPackage preferredLocalizationName]): Used HardAutorelease() instead of WebCFAutorelease(). * WebView/WebDeviceOrientationProviderMock.mm: (-[WebDeviceOrientationProviderMockInternal lastOrientation]): Stop leaking WebDeviceOrientations. * WebView/WebPDFRepresentation.mm: (-[WebPDFRepresentation convertPostScriptDataSourceToPDF:]): Used HardAutorelease() instead of WebCFAutorelease(). * WebView/WebView.mm: (+[WebView _setCacheModel:]): Ditto. (-[WebView _removeObjectForIdentifier:]): Ditto. Source/WebKit2: * UIProcess/API/mac/WKBrowsingContextController.mm: (autoreleased): Don't leak CFURLs when in Objective-C GC. * WebProcess/WebPage/mac/WKAccessibilityWebPageObject.mm: (-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]): Don't leak CFStrings when in Objective-C GC. Source/WTF: * wtf/ObjcRuntimeExtras.h: (HardAutorelease): Added a canonical implementation of HardAutorelease. Tools: * DumpRenderTree/mac/DumpRenderTreePasteboard.m: (-[LocalPasteboard initWithName:]): Called [super init] first so that we don't later use ivars from the wrong self. * DumpRenderTree/mac/TestRunnerMac.mm: (-[APITestDelegate initWithCompletionCondition:]): Ditto. * TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsTest.mm: (TestWebKitAPI::TEST): Don't leak WKProcessGroups, WKBrowsingContextGroups, and WKViews. Canonical link: https://commits.webkit.org/138298@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-08-26 22:40:55 +00:00
}
[Mac] No need for HardAutorelease, which is same as CFBridgingRelease https://bugs.webkit.org/show_bug.cgi?id=120569 Reviewed by Andy Estes. Source/JavaScriptCore: * API/JSValue.mm: (valueToString): Use CFBridgingRelease. Source/WebCore: * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (AXTextMarkerRange): (AXTextMarkerRangeStart): (AXTextMarkerRangeEnd): (textMarkerForVisiblePosition): Use CFBridgingRelease. * platform/mac/KURLMac.mm: (WebCore::KURL::operator NSURL *): Use CFBridgingRelease. (WebCore::KURL::createCFURL): Get rid of needless local variable. * platform/mac/WebCoreNSURLExtras.mm: (WebCore::mapHostNameWithRange): (WebCore::URLWithData): (WebCore::userVisibleString): * platform/text/mac/StringImplMac.mm: (WTF::StringImpl::operator NSString *): Use CFBridgingRelease. Source/WebKit/mac: * Misc/WebNSFileManagerExtras.mm: (-[NSFileManager _webkit_startupVolumeName]): Removed some unneeded locals. Got rid of the pointless ref/leakRef/HardAutorelease dance, and replaced it with a [[x copy] autorelease]. * Misc/WebNSURLExtras.mm: (-[NSURL _web_URLWithLowercasedScheme]): Use CFBridgingRelease, and got rid of unneeded type casts. * Plugins/WebBasePluginPackage.mm: (+[WebBasePluginPackage preferredLocalizationName]): Use CFBridgingRelease. * WebView/WebPDFRepresentation.mm: (-[WebPDFRepresentation convertPostScriptDataSourceToPDF:]): Ditto. * WebView/WebView.mm: (+[WebView _setCacheModel:]): Use CFBridgingRelease and got rid of unneeded type cast. Source/WebKit2: * Platform/mac/StringUtilities.mm: (WebKit::nsStringFromWebCoreString): Use CFBridgingRelease. Also changed condition to be a little cleaner and use a constant string for empty strings as well as null strings. * UIProcess/API/mac/WKBrowsingContextController.mm: (autoreleased): Switched from autorelease to CFBridgingRelease for strings, which eliminates a type cast and makes this work under GC, although I don't think we should compile WebKit2 for GC. * WebProcess/WebPage/mac/WKAccessibilityWebPageObject.mm: (-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]): Use CFBridgingRelease. Source/WTF: * wtf/ObjcRuntimeExtras.h: Added a FIXME about miscapitalization of ObjC. Deleted HardAutorelease. (wtfObjcMsgSend): Dropped the use of abbreviations in local class and argument names. (wtfCallIMP): Ditto. Tools: * DumpRenderTree/mac/DumpRenderTree.mm: (dump): Use CFBridgingRelease. Canonical link: https://commits.webkit.org/138589@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154963 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-09-02 18:55:05 +00:00
#endif // __cplusplus