Chromium Code Reviews| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 66 | 66 |
| 67 // Do not recalculate m_uniqueName if there is no real change of m_name. | 67 // Do not recalculate m_uniqueName if there is no real change of m_name. |
| 68 // This is not just a performance optimization - other code relies on the | 68 // This is not just a performance optimization - other code relies on the |
| 69 // assumption that unique name shouldn't change if the assigned name didn't | 69 // assumption that unique name shouldn't change if the assigned name didn't |
| 70 // change (i.e. code in content::FrameTreeNode::SetFrameName). | 70 // change (i.e. code in content::FrameTreeNode::SetFrameName). |
| 71 if (m_name == name) | 71 if (m_name == name) |
| 72 return; | 72 return; |
| 73 | 73 |
| 74 m_name = name; | 74 m_name = name; |
| 75 | 75 |
| 76 // https://crbug.com/607205: Make sure m_uniqueName doesn't change after | |
| 77 // initial navigation - session history depends on this. | |
| 78 if (m_thisFrame->isLocalFrame()) { | |
|
dcheng
2016/09/07 19:54:13
This check is redundant (see the DCHECK on line 59
Łukasz Anforowicz
2016/09/09 16:21:38
Done.
| |
| 79 LocalFrame* localFrame = toLocalFrame(m_thisFrame); | |
| 80 if (localFrame->loader().stateMachine()->committedFirstRealDocumentLoad( )) | |
| 81 return; | |
| 82 } | |
| 83 | |
| 76 // Remove our old frame name so it's not considered in calculateUniqueNameFo rChildFrame | 84 // Remove our old frame name so it's not considered in calculateUniqueNameFo rChildFrame |
| 77 // and appendUniqueSuffix calls below. | 85 // and appendUniqueSuffix calls below. |
| 78 m_uniqueName = AtomicString(); | 86 m_uniqueName = AtomicString(); |
| 79 | 87 |
| 80 // Calculate a new unique name based on inputs. | 88 // Calculate a new unique name based on inputs. |
| 81 if (parent()) { | 89 if (parent()) { |
| 82 setUniqueName( | 90 setUniqueName( |
| 83 parent()->tree().calculateUniqueNameForChildFrame(m_thisFrame, name, nullAtom)); | 91 parent()->tree().calculateUniqueNameForChildFrame(m_thisFrame, name, nullAtom)); |
| 84 } else if (name.isEmpty() || !uniqueNameExists(name)) { | 92 } else if (name.isEmpty() || !uniqueNameExists(name)) { |
| 85 // Only main frame can have an empty unique name, so for main frames | 93 // Only main frame can have an empty unique name, so for main frames |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 594 { | 602 { |
| 595 if (!frame) { | 603 if (!frame) { |
| 596 printf("Null input frame\n"); | 604 printf("Null input frame\n"); |
| 597 return; | 605 return; |
| 598 } | 606 } |
| 599 | 607 |
| 600 printFrames(frame->tree().top(), frame, 0); | 608 printFrames(frame->tree().top(), frame, 0); |
| 601 } | 609 } |
| 602 | 610 |
| 603 #endif | 611 #endif |
| OLD | NEW |