| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 } | 100 } |
| 101 | 101 |
| 102 // TODO(lukasza): We would like to assert uniqueness below (i.e. by calling | 102 // TODO(lukasza): We would like to assert uniqueness below (i.e. by calling |
| 103 // setUniqueName), but | 103 // setUniqueName), but |
| 104 // 1) uniqueness is currently violated by provisional/old frame pairs. | 104 // 1) uniqueness is currently violated by provisional/old frame pairs. |
| 105 // 2) there is an unresolved race between 2 OOPIFs, that can result in a | 105 // 2) there is an unresolved race between 2 OOPIFs, that can result in a |
| 106 // non-unique |uniqueName| - see https://crbug.com/558680#c14. | 106 // non-unique |uniqueName| - see https://crbug.com/558680#c14. |
| 107 m_uniqueName = uniqueName; | 107 m_uniqueName = uniqueName; |
| 108 } | 108 } |
| 109 | 109 |
| 110 DISABLE_CFI_PERF | |
| 111 Frame* FrameTree::parent() const { | 110 Frame* FrameTree::parent() const { |
| 112 if (!m_thisFrame->client()) | 111 if (!m_thisFrame->client()) |
| 113 return nullptr; | 112 return nullptr; |
| 114 return m_thisFrame->client()->parent(); | 113 return m_thisFrame->client()->parent(); |
| 115 } | 114 } |
| 116 | 115 |
| 117 Frame* FrameTree::top() const { | 116 Frame* FrameTree::top() const { |
| 118 // FIXME: top() should never return null, so here are some hacks to deal | 117 // FIXME: top() should never return null, so here are some hacks to deal |
| 119 // with EmptyFrameLoaderClient and cases where the frame is detached | 118 // with EmptyFrameLoaderClient and cases where the frame is detached |
| 120 // already... | 119 // already... |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 if (m_thisFrame->page() != ancestor->page()) | 469 if (m_thisFrame->page() != ancestor->page()) |
| 471 return false; | 470 return false; |
| 472 | 471 |
| 473 for (Frame* frame = m_thisFrame; frame; frame = frame->tree().parent()) { | 472 for (Frame* frame = m_thisFrame; frame; frame = frame->tree().parent()) { |
| 474 if (frame == ancestor) | 473 if (frame == ancestor) |
| 475 return true; | 474 return true; |
| 476 } | 475 } |
| 477 return false; | 476 return false; |
| 478 } | 477 } |
| 479 | 478 |
| 480 DISABLE_CFI_PERF | |
| 481 Frame* FrameTree::traverseNext(const Frame* stayWithin) const { | 479 Frame* FrameTree::traverseNext(const Frame* stayWithin) const { |
| 482 Frame* child = firstChild(); | 480 Frame* child = firstChild(); |
| 483 if (child) { | 481 if (child) { |
| 484 ASSERT(!stayWithin || child->tree().isDescendantOf(stayWithin)); | 482 ASSERT(!stayWithin || child->tree().isDescendantOf(stayWithin)); |
| 485 return child; | 483 return child; |
| 486 } | 484 } |
| 487 | 485 |
| 488 if (m_thisFrame == stayWithin) | 486 if (m_thisFrame == stayWithin) |
| 489 return nullptr; | 487 return nullptr; |
| 490 | 488 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 void showFrameTree(const blink::Frame* frame) { | 593 void showFrameTree(const blink::Frame* frame) { |
| 596 if (!frame) { | 594 if (!frame) { |
| 597 printf("Null input frame\n"); | 595 printf("Null input frame\n"); |
| 598 return; | 596 return; |
| 599 } | 597 } |
| 600 | 598 |
| 601 printFrames(frame->tree().top(), frame, 0); | 599 printFrames(frame->tree().top(), frame, 0); |
| 602 } | 600 } |
| 603 | 601 |
| 604 #endif | 602 #endif |
| OLD | NEW |