[webkit-dev] How to add a new interface for ObjC bindings?

David Kilzer ddkilzer at webkit.org
Tue Dec 22 19:28:59 PST 2009


The Headers directory is for public API exposed by a framework on Mac OS X.  The PrivateHeaders directory is a staging area for API that will be made public some day.  Note that WebCore.framework is not a public framework on Mac OS X--it's an implementation detail of WebKit.framework--so the only Headers (public API) directory between the two is WebKit.framework/Headers.

Since the DOMFile.h header is only in WebCore.framework/PrivateHeaders, you only have to worry about putting DOMBlob.h there as well.  The easiest way to do this is to look for every place the DOMFile.h header is referenced in WebCore.  This is a bit tricky since "File" is so generic, so let's use DOMFileList.h instead (and leave off the "DOM" prefix since that's added as needed):

$ grep -l -r FileList WebCore
WebCore/bindings/objc/DOMInternal.h
WebCore/ChangeLog
WebCore/ChangeLog-2008-08-10
WebCore/DerivedSources.cpp
WebCore/DerivedSources.make
WebCore/GNUmakefile.am
WebCore/html/File.h
WebCore/html/FileList.cpp
WebCore/html/FileList.h
WebCore/html/FileList.idl
WebCore/html/HTMLFormElement.cpp
WebCore/html/HTMLInputElement.cpp
WebCore/html/HTMLInputElement.h
WebCore/html/HTMLInputElement.idl
WebCore/page/Chrome.cpp
WebCore/page/DOMWindow.idl
WebCore/rendering/RenderFileUploadControl.cpp
WebCore/WebCore.order
WebCore/WebCore.pro
WebCore/WebCore.scons
WebCore/WebCore.vcproj/WebCore.vcproj
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/WebCoreSources.bkl

(Yes, I'm using an older tree because I'm in the middle of a bisect right now.)

Ignoring the places where it's used as an include or in the build system files, we have:

WebCore/DerivedSources.cpp
WebCore/DerivedSources.make

So basically what you want to do is mimic how "FileList" is referenced in these files for "Blob".  (Note that if there is no generated DOMBlobPrivate.h or DOMBlobInternl.h, then you don't have to include those in the changes.)

It's also a good idea to mimic how "FileList" (or "File") is used in the build files as well.  That will make it easier to prevent broken builds in various ports when this change lands.

Hope that helps!

Dave


From: Jian Li <jianli at chromium.org>
>To: David Kilzer <ddkilzer at webkit.org>
>Cc: webkit-dev at lists.webkit.org
>Sent: Tue, December 22, 2009 6:54:29 PM
>Subject: Re: [webkit-dev] How to add a new interface for ObjC bindings?
>
>
>Thanks for all your information. Do you mean to add files into MigrateHeaders.make as the following?
>    $(PRIVATE_HEADERS_DIR)/DOMBlob.h \
>    $(INTERNAL_HEADERS_DIR)/DOMBlobInternal.h \
>
>
>What's the difference between adding into PRIVATE_HEADERS_DIR and adding into PUBLIC_HEADERS_DIR? Blob interface is indeed the new superclass introduced for the existing File interface per the File API spec. Since File has already been added into PUBLIC_HEADERS_DIR, do we need to do the same thing for Blob?
>
>
>I still can't get the generated DOMBlob.h and DOMBlobInternal.h copied into PrivateHeaders of WebCore.framework. From the build output, I can see that PBXCp is called for DOMFile.h, but not for DOMBlob.h. Do I need to change other script file or makefile? Or I should change WebCore.xcodeproj to add the generated header files. If so, which group should I add to?
>
>
>On Tue, Dec 22, 2009 at 4:04 PM, David Kilzer <ddkilzer at webkit.org> wrote:
>
>All the magic for the Obj-C DOM headers happens in:
>>
>>
>>WebCore/DerivedSources.make
>>WebKit/mac/MigrateHeaders.make
>>
>>
>>It should be added as a PrivateHeader first, if at all.  Someone else will have to address COM bindings since I don't know much about those.
>>
>>
>>Dave
>>
>>
>>
>>
>>From: Jian Li
>>> <jianli at chromium.org>
>>>To: webkit-dev at lists.webkit.org
>>>Sent: Tue, December 22, 2009 3:05:08 PM
>>>Subject: [webkit-dev] How to add a new interface for ObjC bindings?
>>>
>>>
>>>>>>Hi,
>>>
>>>
>>>I am working on adding Blob interface based on the latest File API spec. I have one question about the various kinds of bindings we need to put up for this new interface. I got JSC and V8 bindings generated and built successfully. I have some problem with ObjC bindings. What's the right procedure to add a new interface for ObjC bindings? I could see DOMBlob.h being created under Debug/DerivedSources/WebCore, but not under Debug/WebCore.framework/PrivateHeaders and Debug/WebKit.framework/Headers as other interfaces do. How could I change WebCore.xcodeproj to add the build steps for these? Any other things I need to pay attention to?
>>>
>>>
>>>In addition, where do we use COM bindings? Is it only used when building WebKit under Windows?
>>>
>>>
>>>Thanks,
>>>
>>>
>>>Jian
>>>
>>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20091222/8ad2876c/attachment.html>


More information about the webkit-dev mailing list