Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(275)

Side by Side Diff: Source/WebCore/bindings/ScriptControllerBase.cpp

Issue 7158003: Merge 87959 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/742/
Patch Set: Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « LayoutTests/webarchive/loading/resources/javascript-url-iframe-crash.webarchive ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999-2001 Harri Porten (porten@kde.org) 2 * Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
3 * Copyright (C) 2001 Peter Kelly (pmk@post.com) 3 * Copyright (C) 2001 Peter Kelly (pmk@post.com)
4 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. 4 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public 7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 if (!result.getString(scriptResult)) 103 if (!result.getString(scriptResult))
104 return true; 104 return true;
105 #endif 105 #endif
106 106
107 // FIXME: We should always replace the document, but doing so 107 // FIXME: We should always replace the document, but doing so
108 // synchronously can cause crashes: 108 // synchronously can cause crashes:
109 // http://bugs.webkit.org/show_bug.cgi?id=16782 109 // http://bugs.webkit.org/show_bug.cgi?id=16782
110 if (shouldReplaceDocumentIfJavaScriptURL == ReplaceDocumentIfJavaScriptURL) { 110 if (shouldReplaceDocumentIfJavaScriptURL == ReplaceDocumentIfJavaScriptURL) {
111 // We're still in a frame, so there should be a DocumentLoader. 111 // We're still in a frame, so there should be a DocumentLoader.
112 ASSERT(m_frame->document()->loader()); 112 ASSERT(m_frame->document()->loader());
113 if (DocumentLoader* loader = m_frame->document()->loader()) 113
114 // DocumentWriter::replaceDocument can cause the DocumentLoader to get d eref'ed and possible destroyed,
115 // so protect it with a RefPtr.
116 if (RefPtr<DocumentLoader> loader = m_frame->document()->loader())
114 loader->writer()->replaceDocument(scriptResult); 117 loader->writer()->replaceDocument(scriptResult);
115 } 118 }
116 return true; 119 return true;
117 } 120 }
118 121
119 } // namespace WebCore 122 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/webarchive/loading/resources/javascript-url-iframe-crash.webarchive ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698