OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 |
OLD | NEW |