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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
3 * Copyright (C) 2006 Apple Computer, Inc. 3 * Copyright (C) 2006 Apple Computer, Inc.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 , m_scopedChildCount(invalidChildCount) 47 , m_scopedChildCount(invalidChildCount)
48 { 48 {
49 } 49 }
50 50
51 FrameTree::~FrameTree() 51 FrameTree::~FrameTree()
52 { 52 {
53 } 53 }
54 54
55 void FrameTree::setName(const AtomicString& name) 55 void FrameTree::setName(const AtomicString& name)
56 { 56 {
57 // Do not recalculate m_uniqueName if there is no real change of m_name
58 // *and* m_uniqueName has been already calculated. This ensures that
59 // m_uniqueName stays the same in this scenario (regenerating m_uniqueName
60 // can result in a different unique name value, because it depends on the
61 // state of other frames in the frame tree).
62 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
63 return;
64
57 m_name = name; 65 m_name = name;
58 66
59 // Remove our old frame name so it's not considered in calculateUniqueNameFo rChildFrame 67 // Remove our old frame name so it's not considered in calculateUniqueNameFo rChildFrame
60 // and appendUniqueSuffix calls below. 68 // and appendUniqueSuffix calls below.
61 m_uniqueName = AtomicString(); 69 m_uniqueName = AtomicString();
62 70
63 // Calculate a new unique name based on inputs. 71 // Calculate a new unique name based on inputs.
64 if (parent()) { 72 if (parent()) {
65 setUniqueName( 73 setUniqueName(
66 parent()->tree().calculateUniqueNameForChildFrame(m_thisFrame, name, nullAtom)); 74 parent()->tree().calculateUniqueNameForChildFrame(m_thisFrame, name, nullAtom));
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 { 585 {
578 if (!frame) { 586 if (!frame) {
579 printf("Null input frame\n"); 587 printf("Null input frame\n");
580 return; 588 return;
581 } 589 }
582 590
583 printFrames(frame->tree().top(), frame, 0); 591 printFrames(frame->tree().top(), frame, 0);
584 } 592 }
585 593
586 #endif 594 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698