Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1394)

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

Issue 2053903002: Returning early when setting a frame name to the same name. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/page/FrameTree.cpp
diff --git a/third_party/WebKit/Source/core/page/FrameTree.cpp b/third_party/WebKit/Source/core/page/FrameTree.cpp
index 827cbb629e79a1ef1051c50fd41c00950a8d6f15..58960f49e4cc02f63baddc753ceb4480bd7b875f 100644
--- a/third_party/WebKit/Source/core/page/FrameTree.cpp
+++ b/third_party/WebKit/Source/core/page/FrameTree.cpp
@@ -54,6 +54,14 @@ FrameTree::~FrameTree()
void FrameTree::setName(const AtomicString& name)
{
+ // Do not recalculate m_uniqueName if there is no real change of m_name
+ // *and* m_uniqueName has been already calculated. This ensures that
+ // m_uniqueName stays the same in this scenario (regenerating m_uniqueName
+ // can result in a different unique name value, because it depends on the
+ // state of other frames in the frame tree).
+ if (m_name == name && !m_uniqueName.isNull())
Łukasz Anforowicz 2016/06/10 00:06:57 This would be really easy to understand if this co
dcheng 2016/06/10 23:51:14 As we discussed, let's try to elaborate this comme
Łukasz Anforowicz 2016/06/14 23:58:42 Unless there is an assert, as in patchset #3? Hmm
+ return;
+
m_name = name;
// Remove our old frame name so it's not considered in calculateUniqueNameForChildFrame

Powered by Google App Engine
This is Rietveld 408576698