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 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 423 | 423 |
| 424 for (Frame* frame = page->mainFrame(); frame; | 424 for (Frame* frame = page->mainFrame(); frame; |
| 425 frame = frame->tree().traverseNext()) { | 425 frame = frame->tree().traverseNext()) { |
| 426 if (frame->tree().name() == name) | 426 if (frame->tree().name() == name) |
| 427 return frame; | 427 return frame; |
| 428 } | 428 } |
| 429 | 429 |
| 430 // Search the entire tree of each of the other pages in this namespace. | 430 // Search the entire tree of each of the other pages in this namespace. |
| 431 // FIXME: Is random order OK? | 431 // FIXME: Is random order OK? |
| 432 for (const Page* otherPage : Page::ordinaryPages()) { | 432 for (const Page* otherPage : Page::ordinaryPages()) { |
| 433 if (otherPage == page) | 433 if (otherPage == page || otherPage->isClosing()) |
|
dcheng
2016/12/15 19:11:38
Another alternative is to check the main frame's w
| |
| 434 continue; | 434 continue; |
| 435 for (Frame* frame = otherPage->mainFrame(); frame; | 435 for (Frame* frame = otherPage->mainFrame(); frame; |
| 436 frame = frame->tree().traverseNext()) { | 436 frame = frame->tree().traverseNext()) { |
| 437 if (frame->tree().name() == name) | 437 if (frame->tree().name() == name) |
| 438 return frame; | 438 return frame; |
| 439 } | 439 } |
| 440 } | 440 } |
| 441 | 441 |
| 442 return nullptr; | 442 return nullptr; |
| 443 } | 443 } |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 538 void showFrameTree(const blink::Frame* frame) { | 538 void showFrameTree(const blink::Frame* frame) { |
| 539 if (!frame) { | 539 if (!frame) { |
| 540 printf("Null input frame\n"); | 540 printf("Null input frame\n"); |
| 541 return; | 541 return; |
| 542 } | 542 } |
| 543 | 543 |
| 544 printFrames(frame->tree().top(), frame, 0); | 544 printFrames(frame->tree().top(), frame, 0); |
| 545 } | 545 } |
| 546 | 546 |
| 547 #endif | 547 #endif |
| OLD | NEW |