Bug 10714 - ObjC autogeneration needs safe-guards against easily modifying the public API
Summary: ObjC autogeneration needs safe-guards against easily modifying the public API
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit API (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Major
Assignee: Timothy Hatcher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-03 13:29 PDT by Timothy Hatcher
Modified: 2006-09-04 19:39 PDT (History)
0 users

See Also:


Attachments
Fixes this along with some other tweaks (104.28 KB, patch)
2006-09-04 17:33 PDT, Timothy Hatcher
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Timothy Hatcher 2006-09-03 13:29:41 PDT
The Exclude=ObjC attribute is used right now to preventing adding API that has not been approved. Ususally this happens by adding to a private header first, not just excluding it.

We need a way to prevent acedental additions to the public API, an opt-in process. Right now even Exclude=ObjC is faulty if someone forgets to add it when making changes to the IDL files.

I propose a file that contains the interfaces for all the public API. This can be cross referenced for changes and omisions when the auto-generation script makes the real interfaces. Only methods in the reference file will be public, everything else will be added to a private header. And Exclude=ObjC will only be used for the rare case when we don't want something exposed to ObjC.
Comment 1 Timothy Hatcher 2006-09-03 13:30:17 PDT
I have a working patch for this that I am cleaning up.
Comment 2 Timothy Hatcher 2006-09-04 17:33:47 PDT
Created attachment 10397 [details]
Fixes this along with some other tweaks

- New PublicDOMInterfaces.h file is consulted when generating
  the ObjC DOM files. All public DOM class interfaces, properties
  and methods need to be in this file. Anything not in the file will
  be generated into the appropriate private header file. During
  generation if something changed or is missing in the public API
  a build error will occur. New interfaces added to the IDLs files
  will now not automatically be reflected in the public ObjC API.
  Methods commented out in PublicDOMInterfaces.h are pending public
  and will be uncommented once approved.

- Removed most of the Exclude=ObjC uses from the IDL files. This
  attribute was mostly used to prevent changes to the public headers.

- Make a new parameter name if the original conflicts with a property name.

- Simplified the generation code for dealing with exceptions.

- Moved file opens to WriteData. Files are unlinked before
  being opened to work around a Leopard file truncation bug.

- Fixed #imports for DOMImplementation to be DOMDOMImplementation.h
Comment 3 Darin Adler 2006-09-04 18:37:13 PDT
Comment on attachment 10397 [details]
Fixes this along with some other tweaks

r=me
Comment 4 Timothy Hatcher 2006-09-04 19:39:22 PDT
Landed in r16225.