FrameTreeNodeID outside content: The name of the getter

3 views
Skip to first unread message

Rob Wu

unread,
Dec 8, 2015, 5:40:57 PM12/8/15
to site-isol...@chromium.org, Nasko Oskov, Charlie Reis, Nick Carter
The value of FrameTreeNodeID will be exposed outside of content [1], because it is the only stable ID that can identify a frame.

Charlie & Nasko requested to expose this ID via a name that is different from FrameTreeNodeID (FTN ID), because FTNs are a concept that is internal to content/ [2].
I considered different names (e.g. UniqueFrameId, ContentFrameId, GlobalFrameId, StableFrameId), but ended up with sticking to FrameTreeNodeID because:
- FTN ID is already leaked outside of content/ (e.g. [3])
- Having another name that means exactly the same is confusing.
- If properly documented, the name does not matter that much, as long as the meaning is unambiguous and obvious. My alternative names are not better in this regard.
- I'm using "FrameTreeNodeID" instead of "FrameTreeNodeId" (camelCase is preferred these days) because all IDs in RenderFrameHost end with "ID" instead of "Id", and I preferred local consistency over the global coding standard.

content/ and extensions/ interfaces via the FTN ID through a single file, so if something better comes up than a FTN ID, it can easily be swapped.

Do you all agree with exposing the ID as GetFrameTreeNodeID, or do you have a strong argument for something else?

Nick Carter

unread,
Dec 8, 2015, 6:14:29 PM12/8/15
to Rob Wu, site-isol...@chromium.org, Nasko Oskov, Charlie Reis
Go with GetFrameTreeNodeId

All your arguments are pretty convincing. And I polled Nasko and Charlie, and nobody has a better idea.

Whether to capitalize the terminal 'D': the rule is to use Id style in "new or modified" code; I think this counts as a sufficient modification to use the new style, so go with the lower case approach. If you wish to draft a patch updating the existing capitalized FrameTreeNodeID cases so that we're consistent, I would lgtm it -- there are not that many: https://code.google.com/p/chromium/codesearch#search/&q=file:content%20FrameTreeNodeID%20case:yes&sq=package:chromium&type=cs.

Reply all
Reply to author
Forward
0 new messages