Chromium Code Reviews

Unified Diff: third_party/WebKit/Source/core/page/FrameTree.h

Issue 1635873003: Replicating WebFrame::uniqueName across renderers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dump-render-tree3
Patch Set: Added FrameTreeHelpers::createLocalChild. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: third_party/WebKit/Source/core/page/FrameTree.h
diff --git a/third_party/WebKit/Source/core/page/FrameTree.h b/third_party/WebKit/Source/core/page/FrameTree.h
index 37493906a646304b783ede027f16b6efaf73bbdf..a6b68aae96cce25a1fdd520749877c58c40c9ee8 100644
--- a/third_party/WebKit/Source/core/page/FrameTree.h
+++ b/third_party/WebKit/Source/core/page/FrameTree.h
@@ -42,10 +42,11 @@ public:
// |fallbackName| is used as a source of uniqueName.
void setName(const AtomicString& name, const AtomicString& fallbackName = nullAtom);
- // Directly assigns both the name and uniqueName. Should only be used when
- // switching between LocalFrames and RemoteFrames for the same logical frame
- // so that the unique name stays unique.
- void setNameForReplacementFrame(const AtomicString& name, const AtomicString& uniqueName);
+ // Directly assigns both the name and uniqueName. Can be used when
+ // |uniqueName| is already known (i.e. when it has been precalculated by
+ // calculateUniqueNameForNewChildFrame OR when replicating the name between
+ // LocalFrames and RemoteFrames for the same logical frame).
+ void setPrecalculatedName(const AtomicString& name, const AtomicString& uniqueName);
Frame* parent() const;
Frame* top() const;
@@ -70,9 +71,16 @@ public:
DECLARE_TRACE();
+ AtomicString calculateUniqueNameForNewChildFrame(
+ const AtomicString& name,
+ const AtomicString& fallbackName = nullAtom) const;
+
private:
Frame* deepLastChild() const;
- AtomicString uniqueChildName(const AtomicString& requestedName) const;
+ AtomicString calculateUniqueNameForChildFrame(
+ bool existingChildFrame,
+ const AtomicString& requestedName,
+ const AtomicString& fallbackName = nullAtom) const;
bool uniqueNameExists(const AtomicString& name) const;
RawPtrWillBeMember<Frame> m_thisFrame;

Powered by Google App Engine