Chromium Code Reviews
DescriptionRefactor UniqueNameHelper to use an adapter pattern for code sharing.
This currently lives in //content/renderer and uses blink::WebFrame
directly. However, ExplodedFrameState will also need to do unique
name generation in the future when migrating unique name schemes.
Since ExplodedFrameState is in //content/common and can't reference
non-POD Blink types, this CL changes UniqueNameHelper to factor the
blink::WebFrame* specific logic behind an adapter interface.
The trickier part of this is that the adapter interface can't easily
provide lower-level concepts like Parent(), FirstSibling(), etc to
walk the frame tree: the adapter interface is virtual, so it can't
simply manufacture on-the-fly by-value wrappers for the return
values of these methods--the storage would need to be owned by each
RenderFrameImpl *and* RenderFrameProxy.
Instead, the adapter provides higher-level concepts. This will come
in useful in followup patches where methods like GetFramePosition()
can be extracted from ExplodedFrameState's generated unique name
rather than walking ExplodedFrameState's and assuming the ordering
matches DOM insertion order, etc.
This also allows some internal cleanup in UniqueNameHelper to more
cleanly handle the 'create new child frame' case.
BUG=626202, 645123
Review-Url: https://codereview.chromium.org/2902253003
Cr-Commit-Position: refs/heads/master@{#474839}
Committed: https://chromium.googlesource.com/chromium/src/+/61b2c92224f1bb6db51b0d7b9a84a08dd451f658
Patch Set 1 #Patch Set 2 : Add comment. #
Total comments: 15
Patch Set 3 : Address comments. #Patch Set 4 : really address comments #
Total comments: 4
Patch Set 5 : address more comments #Patch Set 6 : Fix off by one bug #
Messages
Total messages: 30 (20 generated)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||