<div class="gmail_quote">On Fri, Jun 4, 2010 at 11:15 AM, Peter Kasting <span dir="ltr"><<a href="mailto:pkasting@google.com">pkasting@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="gmail_quote"><div class="im">On Fri, Jun 4, 2010 at 11:11 AM, Darin Adler <span dir="ltr"><<a href="mailto:darin@apple.com" target="_blank">darin@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
If the two enum types are identical except for their names, then this doesn’t firewall the types at all.</blockquote><div><br></div></div><div>It doesn't firewall the concepts (but then, it's hard for an embedding layer to not transmit any concepts, as that's basically the point). It does firewall the actual #includes, and thus provides source independence for the embedder/a point where the WebKit side can be built as its own independent DLL (if we want to).</div>
<div><br></div><font color="#888888"><div>PK</div></font></div>
</blockquote></div><br><div><br></div><div>Right. Insulating the embedder from WebCore headers is very important. It helps avoid accidental dependencies on more of WebCore than just simple constant values.</div><div><br>
</div><div>I can imagine a tool that would parse a WebCore enum and convert it to a WebKit API equivalent, but that seems dangerous as it would mean that a WebCore change could change the API. I think it is better for API changes to be more explicit.</div>
<div><br></div><div>I also agree with Peter that a case-switch translation would be no less work to maintain. Our use of compile-time asserts catches any drift between the enum values (with the exception of newly appended WebCore enum values). However, a case-switch translation may become necessary if a WebCore enum value were deleted. Then we'd need to make a decision between either deleting the corresponding API enum value or providing compatible support for it somehow. If we chose the latter, then the API enum and the WebCore enum would no longer be 1-1, so we'd need a case-switch translation to cope.</div>
<div><br></div><div>-Darin</div>