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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 if (!page) | 255 if (!page) |
256 return nullptr; | 256 return nullptr; |
257 | 257 |
258 for (Frame* frame = page->mainFrame(); frame; frame = frame->tree().traverse
Next()) { | 258 for (Frame* frame = page->mainFrame(); frame; frame = frame->tree().traverse
Next()) { |
259 if (frame->tree().name() == name) | 259 if (frame->tree().name() == name) |
260 return frame; | 260 return frame; |
261 } | 261 } |
262 | 262 |
263 // Search the entire tree of each of the other pages in this namespace. | 263 // Search the entire tree of each of the other pages in this namespace. |
264 // FIXME: Is random order OK? | 264 // FIXME: Is random order OK? |
265 const WillBePersistentHeapHashSet<RawPtrWillBeWeakMember<Page>>& pages = Pag
e::ordinaryPages(); | 265 for (const Page* otherPage : Page::ordinaryPages()) { |
266 for (const Page* otherPage : pages) { | 266 if (otherPage == page) |
267 if (otherPage != page) { | 267 continue; |
268 for (Frame* frame = otherPage->mainFrame(); frame; frame = frame->tr
ee().traverseNext()) { | 268 for (Frame* frame = otherPage->mainFrame(); frame; frame = frame->tree()
.traverseNext()) { |
269 if (frame->tree().name() == name) | 269 if (frame->tree().name() == name) |
270 return frame; | 270 return frame; |
271 } | |
272 } | 271 } |
273 } | 272 } |
274 | 273 |
275 return nullptr; | 274 return nullptr; |
276 } | 275 } |
277 | 276 |
278 bool FrameTree::isDescendantOf(const Frame* ancestor) const | 277 bool FrameTree::isDescendantOf(const Frame* ancestor) const |
279 { | 278 { |
280 if (!ancestor) | 279 if (!ancestor) |
281 return false; | 280 return false; |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 { | 402 { |
404 if (!frame) { | 403 if (!frame) { |
405 printf("Null input frame\n"); | 404 printf("Null input frame\n"); |
406 return; | 405 return; |
407 } | 406 } |
408 | 407 |
409 printFrames(frame->tree().top(), frame, 0); | 408 printFrames(frame->tree().top(), frame, 0); |
410 } | 409 } |
411 | 410 |
412 #endif | 411 #endif |
OLD | NEW |