MediaPlayerPrivateAVFoundationCF.cpp currently pulls in AVCF using #pragma comment(lib), it should soft link to the routines it needs instead. Even though we delay load AVCF and related DLLS (see <http://trac.webkit.org/changeset/92035>), because we statically link against the libraries the DLLs are loaded at startup, which likely impacts performance. There's no need to load these until we encounter a media element and even then only if AVFoundation is enabled.
<rdar://problem/9900224>
Unfortunately, all of these functions are declared as __declspec(dllimport), and the existing SOFT_LINK() macro doesn't handle this. For example, if the DLL exports a function named "foo()", the name of the function implemented by SOFT_LINK() has to be called __imp__foo, but we have to use GetProcAddress("foo"). I'll have to create a new flavor of the SOFT_LINK() macro for this. I'll also need a new macro to get at global variables, e.g. __declspec(dllimport) int fooBar.
I don't think soft linking to libdispatch is helpful, since the libdispatch DLL doesn't appear to be delay loaded. I verified using Process Explorer that even with AVFoundation support off, libdispatch.dll is loaded in the web process. I'm guessing that something else in AAS requires it. Updating bug title to reflect this.
Created attachment 104271 [details] Don't soft link to libdispatch
Don't soft link to libdispatch - r93260 <http://trac.webkit.org/changeset/93260>
Created attachment 104407 [details] Soft link against AVFoundationCF and CoreMedia Soft link against AVFoundationCF and CoreMedia
Attachment 104407 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1 Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:55: Alphabetical sorting problem. [build/include_order] [4] Source/WebCore/platform/win/SoftLinking.h:95: Extra space before ( in function call [whitespace/parens] [4] Total errors found: 2 in 6 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 104407 [details] Soft link against AVFoundationCF and CoreMedia View in context: https://bugs.webkit.org/attachment.cgi?id=104407&action=review >> Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:55 >> +#include "AVFoundationCFSoftLinking.h" > > Alphabetical sorting problem. [build/include_order] [4] As noted in the comment above, this is intentional. >> Source/WebCore/platform/win/SoftLinking.h:95 > > Extra space before ( in function call [whitespace/parens] [4] False positive, but this is a complex macro so I'm not sure there's a way to fix this in check-webkit-style.
Committed r93363: <http://trac.webkit.org/changeset/93363>