Changeset 180287 in webkit
- Timestamp:
- Feb 18, 2015 1:13:29 PM (9 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r180286 r180287 1 2015-02-18 David Kilzer <ddkilzer@apple.com> 2 3 Consolidate soft-linked CMTimeMakeWithSeconds() function 4 <http://webkit.org/b/141655> 5 6 Reviewed by Brent Fulgham. 7 8 * Configurations/WebCore.unexp: Remove workaround for 9 CMTimeMakeWithSeconds() weak external. 10 11 * WebCore.vcxproj/WebCore.vcxproj: 12 * WebCore.vcxproj/WebCore.vcxproj.filters: 13 * WebCore.xcodeproj/project.pbxproj: 14 - Add CoreMediaSoftLink.{cpp,h} to the project. 15 16 * platform/cf/CoreMediaSoftLink.cpp: Add. 17 * platform/cf/CoreMediaSoftLink.h: Add. 18 - Implement new strategy where code for soft-linking is only 19 in one place, and the header can simply be included wherever a 20 soft-linked method is needed. 21 22 * platform/graphics/avfoundation/MediaTimeAVFoundation.cpp: 23 * platform/graphics/avfoundation/cf/CoreMediaSoftLinking.h: 24 * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: 25 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: 26 * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: 27 * platform/mac/PlatformClockCM.mm: 28 - Remove old soft-linking strategy and include 29 CoreMediaSoftLink.h. 30 31 * platform/mac/SoftLinking.h: 32 (SOFT_LINK_FUNCTION_DECL): Add. New macro function used for 33 header declaration. Split out from SOFT_LINK() macro. Also 34 stop violating C++ standards by redeclaring an inline function 35 with the exact same signature as an extern "C" function. This 36 now matches what we do on Windows (where Visual C++ already 37 prevented these shenanigans). 38 (SOFT_LINK_FUNCTION_IMPL): Add. New macro function used for 39 source implementation. Split out the from SOFT_LINK() macro. 40 41 * platform/win/SoftLinking.h: 42 (SOFT_LINK_FRAMEWORK): Map mac/SoftLinking.h macro name to 43 Windows macros so we can simplify CoreMediaSoftLink.{cpp,h}. 44 (SOFT_LINK_FUNCTION_DECL): Add. 45 (SOFT_LINK_FUNCTION_IMPL): Add. 46 - New macro functions split out from SOFT_LINK_DLL_IMPORT() 47 macro for header declaration and source implementation. 48 - We assume the __cdecl calling convention because that's what 49 all Apple libraries use, and so we are able to use the exact 50 same macro function on both Mac and Windows to simplify 51 CoreMediaSoftLink.{cpp,h}. 52 1 53 2015-02-18 Brady Eidson <beidson@apple.com> 2 54 -
trunk/Source/WebCore/Configurations/WebCore.unexp
r180282 r180287 53 53 54 54 # Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm 55 _CMTimeMakeWithSeconds56 55 _CMTimeRangeGetEnd 57 56 -
trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
r180193 r180287 8223 8223 <ClCompile Include="..\platform\win\WindowMessageBroadcaster.cpp" /> 8224 8224 <ClCompile Include="..\platform\cf\CFURLExtras.cpp" /> 8225 <ClCompile Include="..\platform\cf\CoreMediaSoftLink.cpp" /> 8225 8226 <ClCompile Include="..\platform\cf\FileSystemCF.cpp" /> 8226 8227 <ClCompile Include="..\platform\cf\URLCF.cpp" /> … … 19762 19763 <ClInclude Include="..\platform\win\WindowsTouch.h" /> 19763 19764 <ClInclude Include="..\platform\cf\CFURLExtras.h" /> 19765 <ClInclude Include="..\platform\cf\CoreMediaSoftLink.h" /> 19764 19766 <ClInclude Include="..\platform\cf\win\CertificateCFWin.h" /> 19765 19767 <ClInclude Include="..\platform\graphics\BitmapImage.h" /> -
trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
r179810 r180287 12170 12170 <Filter>platform\cf</Filter> 12171 12171 </ClInclude> 12172 <ClInclude Include="..\platform\cf\CoreMediaSoftLink.h"> 12173 <Filter>platform\cf</Filter> 12174 </ClInclude> 12172 12175 <ClInclude Include="..\platform\cf\win\CertificateCFWin.h"> 12173 12176 <Filter>platform\cf\win</Filter> -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r180266 r180287 1594 1594 44311CD912E4E257000A8D19 /* DOMDocumentFragmentPrivate.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 44311CD412E4E22D000A8D19 /* DOMDocumentFragmentPrivate.h */; }; 1595 1595 44311F8212E4E66C000A8D19 /* DOMDocumentFragmentInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 85E711450AC5D5340053270F /* DOMDocumentFragmentInternal.h */; }; 1596 443817FF1A91B2F8006E04F2 /* CoreMediaSoftLink.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 443817FD1A91B2F8006E04F2 /* CoreMediaSoftLink.cpp */; }; 1597 443818001A91B2F8006E04F2 /* CoreMediaSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 443817FE1A91B2F8006E04F2 /* CoreMediaSoftLink.h */; }; 1596 1598 443F04270E75C8FB007E5407 /* NetworkStateNotifierIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 443F04260E75C8FB007E5407 /* NetworkStateNotifierIOS.mm */; }; 1597 1599 444D4E230F708B2E003158E0 /* WebCoreURLResponseIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 444D4E210F708B2E003158E0 /* WebCoreURLResponseIOS.mm */; }; … … 8671 8673 44311CD412E4E22D000A8D19 /* DOMDocumentFragmentPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMDocumentFragmentPrivate.h; sourceTree = "<group>"; }; 8672 8674 44311CD512E4E22D000A8D19 /* DOMDocumentPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMDocumentPrivate.h; sourceTree = "<group>"; }; 8675 443817FD1A91B2F8006E04F2 /* CoreMediaSoftLink.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CoreMediaSoftLink.cpp; sourceTree = "<group>"; }; 8676 443817FE1A91B2F8006E04F2 /* CoreMediaSoftLink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreMediaSoftLink.h; sourceTree = "<group>"; }; 8673 8677 443F04260E75C8FB007E5407 /* NetworkStateNotifierIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NetworkStateNotifierIOS.mm; sourceTree = "<group>"; }; 8674 8678 444D4E210F708B2E003158E0 /* WebCoreURLResponseIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreURLResponseIOS.mm; sourceTree = "<group>"; }; … … 15095 15099 isa = PBXGroup; 15096 15100 children = ( 15101 443817FD1A91B2F8006E04F2 /* CoreMediaSoftLink.cpp */, 15102 443817FE1A91B2F8006E04F2 /* CoreMediaSoftLink.h */, 15097 15103 E1A8E56417552B2A007488E7 /* CFURLExtras.cpp */, 15098 15104 E1A8E56517552B2A007488E7 /* CFURLExtras.h */, … … 23702 23708 9746AF2114F4DDE6003E7A71 /* Coordinates.h in Headers */, 23703 23709 CE1252371A15BDBE00864480 /* CoreGraphicsSPI.h in Headers */, 23710 443818001A91B2F8006E04F2 /* CoreMediaSoftLink.h in Headers */, 23704 23711 1C6466251A12C38E0094603C /* CoreTextSPI.h in Headers */, 23705 23712 862F129E18C1576F005C54AF /* CountedUserActivity.h in Headers */, … … 27394 27401 E13F01F11270E19000DFBA71 /* CookieStorageMac.mm in Sources */, 27395 27402 9746AF2114F4DDE6003E7A72 /* Coordinates.cpp in Sources */, 27403 443817FF1A91B2F8006E04F2 /* CoreMediaSoftLink.cpp in Sources */, 27396 27404 BC5EB9500E82056B00B25965 /* CounterDirectives.cpp in Sources */, 27397 27405 9392F1500AD1862300691BD4 /* CounterNode.cpp in Sources */, -
trunk/Source/WebCore/platform/graphics/avfoundation/MediaTimeAVFoundation.cpp
r176863 r180287 29 29 #if USE(AVFOUNDATION) 30 30 31 #include "CoreMediaSoftLink.h" 32 31 33 #if PLATFORM(WIN) 32 34 #include <CoreMedia/CoreMedia.h> … … 35 37 #include "SoftLinking.h" 36 38 SOFT_LINK_FRAMEWORK(CoreMedia) 37 SOFT_LINK(CoreMedia, CMTimeMakeWithSeconds, CMTime, (Float64 seconds, int32_t preferredTimeScale), (seconds, preferredTimeScale))38 39 SOFT_LINK(CoreMedia, CMTimeMake, CMTime, (int64_t value, int32_t timescale), (value, timescale)) 39 40 #endif -
trunk/Source/WebCore/platform/graphics/avfoundation/cf/CoreMediaSoftLinking.h
r165676 r180287 51 51 #define CMTimeMakeFromDictionary softLink_CMTimeMakeFromDictionary 52 52 53 SOFT_LINK_DLL_IMPORT(CoreMedia, CMTimeMakeWithSeconds, CMTime, __cdecl, (Float64 seconds, int32_t preferredTimeScale), (seconds, preferredTimeScale))54 #define CMTimeMakeWithSeconds softLink_CMTimeMakeWithSeconds55 56 53 SOFT_LINK_DLL_IMPORT(CoreMedia, CMTimeRangeGetEnd, CMTime, __cdecl, (CMTimeRange range), (range)) 57 54 #define CMTimeRangeGetEnd softLink_CMTimeRangeGetEnd -
trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp
r178367 r180287 75 75 // The softlink header files must be included after the AVCF and CoreMedia header files. 76 76 #include "AVFoundationCFSoftLinking.h" 77 #include "CoreMediaSoftLink.h" 77 78 #include "CoreMediaSoftLinking.h" 78 79 -
trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
r180187 r180287 36 36 #import "CDMSessionAVFoundationObjC.h" 37 37 #import "Cookie.h" 38 #import "CoreMediaSoftLink.h" 38 39 #import "ExceptionCodePlaceholder.h" 39 40 #import "FloatConversion.h" … … 156 157 157 158 SOFT_LINK(CoreMedia, CMTimeCompare, int32_t, (CMTime time1, CMTime time2), (time1, time2)) 158 SOFT_LINK(CoreMedia, CMTimeMakeWithSeconds, CMTime, (Float64 seconds, int32_t preferredTimeScale), (seconds, preferredTimeScale))159 159 SOFT_LINK(CoreMedia, CMTimeGetSeconds, Float64, (CMTime time), (time)) 160 160 SOFT_LINK(CoreMedia, CMTimeRangeGetEnd, CMTime, (CMTimeRange range), (range)) -
trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm
r179827 r180287 32 32 33 33 #import "AVKitSPI.h" 34 #import "CoreMediaSoftLink.h" 34 35 #import "Logging.h" 35 36 #import "GeometryUtilities.h" … … 66 67 67 68 SOFT_LINK_FRAMEWORK(CoreMedia) 68 SOFT_LINK(CoreMedia, CMTimeMakeWithSeconds, CMTime, (Float64 seconds, int32_t preferredTimeScale), (seconds, preferredTimeScale))69 69 SOFT_LINK(CoreMedia, CMTimeGetSeconds, Float64, (CMTime time), (time)) 70 70 SOFT_LINK(CoreMedia, CMTimeMake, CMTime, (int64_t value, int32_t timescale), (value, timescale)) -
trunk/Source/WebCore/platform/mac/PlatformClockCM.mm
r173318 r180287 30 30 #import "PlatformClockCM.h" 31 31 32 #import "CoreMediaSoftLink.h" 32 33 #import "MediaTimeAVFoundation.h" 33 34 #import "SoftLinking.h" … … 49 50 SOFT_LINK(CoreMedia, CMTimebaseGetTime, CMTime, (CMTimebaseRef timebase), (timebase)) 50 51 SOFT_LINK(CoreMedia, CMTimebaseSetRate, OSStatus, (CMTimebaseRef timebase, Float64 rate), (timebase, rate)) 51 SOFT_LINK(CoreMedia, CMTimeMakeWithSeconds, CMTime, (Float64 seconds, int32_t preferredTimeScale), (seconds, preferredTimeScale))52 52 SOFT_LINK(CoreMedia, CMTimeGetSeconds, Float64, (CMTime time), (time)) 53 53 -
trunk/Source/WebCore/platform/mac/SoftLinking.h
r180154 r180287 110 110 } 111 111 112 #define SOFT_LINK_FUNCTION_DECL(functionName, resultType, parameterDeclarations, parameterNames) \ 113 WTF_EXTERN_C_BEGIN \ 114 resultType functionName parameterDeclarations; \ 115 WTF_EXTERN_C_END \ 116 namespace WebCore { \ 117 extern resultType (*softLink##functionName) parameterDeclarations; \ 118 } \ 119 inline resultType softLink_##functionName parameterDeclarations \ 120 { \ 121 return WebCore::softLink##functionName parameterNames; \ 122 } 123 124 #define SOFT_LINK_FUNCTION_IMPL(framework, functionName, resultType, parameterDeclarations, parameterNames) \ 125 WTF_EXTERN_C_BEGIN \ 126 resultType functionName parameterDeclarations; \ 127 WTF_EXTERN_C_END \ 128 namespace WebCore { \ 129 static resultType init##functionName parameterDeclarations; \ 130 resultType (*softLink##functionName) parameterDeclarations = init##functionName; \ 131 static resultType init##functionName parameterDeclarations \ 132 { \ 133 static dispatch_once_t once; \ 134 dispatch_once(&once, ^{ \ 135 softLink##functionName = (resultType (*) parameterDeclarations) dlsym(framework##Library(), #functionName); \ 136 ASSERT_WITH_MESSAGE(softLink##functionName, "%s", dlerror()); \ 137 }); \ 138 return softLink##functionName parameterNames; \ 139 } \ 140 } 141 112 142 #define SOFT_LINK_MAY_FAIL(framework, functionName, resultType, parameterDeclarations, parameterNames) \ 113 143 WTF_EXTERN_C_BEGIN \ -
trunk/Source/WebCore/platform/win/SoftLinking.h
r180250 r180287 28 28 #include <windows.h> 29 29 #include <wtf/Assertions.h> 30 31 #ifdef DEBUG_ALL 32 #define SOFT_LINK_FRAMEWORK(framework) SOFT_LINK_DEBUG_LIBRARY(framework) 33 #else 34 #define SOFT_LINK_FRAMEWORK(framework) SOFT_LINK_LIBRARY(framework) 35 #endif 30 36 31 37 #define SOFT_LINK_LIBRARY_HELPER(lib, suffix) \ … … 111 117 } 112 118 119 #define SOFT_LINK_FUNCTION_DECL(functionName, resultType, parameterDeclarations, parameterNames) \ 120 namespace WebCore { \ 121 extern resultType(__cdecl*softLink##functionName) parameterDeclarations; \ 122 } \ 123 inline resultType softLink_##functionName parameterDeclarations \ 124 { \ 125 return WebCore::softLink##functionName parameterNames; \ 126 } 127 128 #define SOFT_LINK_FUNCTION_IMPL(library, functionName, resultType, parameterDeclarations, parameterNames) \ 129 namespace WebCore { \ 130 static resultType __cdecl init##functionName parameterDeclarations; \ 131 resultType(__cdecl*softLink##functionName) parameterDeclarations = init##functionName; \ 132 static resultType __cdecl init##functionName parameterDeclarations \ 133 { \ 134 softLink##functionName = reinterpret_cast<resultType (__cdecl*)parameterDeclarations>(SOFT_LINK_GETPROCADDRESS(library##Library(), #functionName)); \ 135 ASSERT(softLink##functionName); \ 136 return softLink##functionName parameterNames; \ 137 } \ 138 } 139 113 140 #define SOFT_LINK_DLL_IMPORT_OPTIONAL(library, functionName, resultType, callingConvention, parameterDeclarations) \ 114 141 typedef resultType (callingConvention *functionName##PtrType) parameterDeclarations; \
Note: See TracChangeset
for help on using the changeset viewer.