Commit 23f95c71 authored by japhet@chromium.org's avatar japhet@chromium.org

Add a RefPtr<Frame> for child in FrameLoader::checkLoadCompleteForThisFrame

Not having this can cause problems in the test harnass, where some of the
FrameLoaderClients do substantially more work than they do in a non-test
environment.

BUG=357283

Review URL: https://codereview.chromium.org/317513002

git-svn-id: svn://svn.chromium.org/blink/trunk@175601 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 415830ea
<iframe></iframe><iframe src=resources/detached-frame.html></iframe>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
</script>
We pass if we don't crash under ASAN
<script>
function test() {
var xhr = new XMLHttpRequest;
xhr.open("GET", "detached-frame.html");
xhr.send();
xhr.onreadystatechange = function() {
if (xhr.readyState == xhr.DONE) {
var parentWindow = window.parent;
parentWindow.document.body.innerHTML += "";
parentWindow.testRunner.notifyDone();
}
}
}
</script>
<body onload="test()">
\ No newline at end of file
...@@ -949,9 +949,9 @@ bool FrameLoader::checkLoadCompleteForThisFrame() ...@@ -949,9 +949,9 @@ bool FrameLoader::checkLoadCompleteForThisFrame()
RefPtr<LocalFrame> protect(m_frame); RefPtr<LocalFrame> protect(m_frame);
bool allChildrenAreDoneLoading = true; bool allChildrenAreDoneLoading = true;
for (Frame* child = m_frame->tree().firstChild(); child; child = child->tree().nextSibling()) { for (RefPtr<Frame> child = m_frame->tree().firstChild(); child; child = child->tree().nextSibling()) {
if (child->isLocalFrame()) if (child->isLocalFrame())
allChildrenAreDoneLoading &= toLocalFrame(child)->loader().checkLoadCompleteForThisFrame(); allChildrenAreDoneLoading &= toLocalFrame(child.get())->loader().checkLoadCompleteForThisFrame();
} }
if (m_state == FrameStateProvisional && m_provisionalDocumentLoader) { if (m_state == FrameStateProvisional && m_provisionalDocumentLoader) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment