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

Unified Diff: third_party/WebKit/Source/core/frame/LocalDOMWindow.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: Replacing part of short-circuiting condition with just an assert. 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/frame/LocalDOMWindow.cpp
diff --git a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
index 130fa525436b6c9a99074fab4f406eab4484d746..20a01b9f6b24d98edfe157a16ae76c19f7f7615c 100644
--- a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
+++ b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
@@ -1056,6 +1056,9 @@ void LocalDOMWindow::setName(const AtomicString& name)
if (!isCurrentlyDisplayedInFrame())
return;
+ if (name == frame()->tree().name())
+ return;
+
frame()->tree().setName(name);
ASSERT(frame()->loader().client());
frame()->loader().client()->didChangeName(name, frame()->tree().uniqueName());
dcheng 2016/06/15 11:18:35 I'd suggest moving this into FrameTree::setName()
Łukasz Anforowicz 2016/06/15 17:46:22 I think this is a great idea. At the same time, I

Powered by Google App Engine
This is Rietveld 408576698