OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2011 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
181 | 181 |
182 if (m_committed) { | 182 if (m_committed) { |
183 // Attempt to stop the frame if the document loader is loading, or if it is done loading but | 183 // Attempt to stop the frame if the document loader is loading, or if it is done loading but |
184 // still parsing. Failure to do so can cause a world leak. | 184 // still parsing. Failure to do so can cause a world leak. |
185 Document* doc = m_frame->document(); | 185 Document* doc = m_frame->document(); |
186 | 186 |
187 if (loading || doc->parsing()) | 187 if (loading || doc->parsing()) |
188 m_frame->loader().stopLoading(); | 188 m_frame->loader().stopLoading(); |
189 } | 189 } |
190 | 190 |
191 if (!loading) | 191 if (!loading) { |
192 // This is needed to cancel multipart loading which can be happening eve n after the frame is loaded. | |
193 m_fetcher->stopFetching(); | |
Nate Chapin
2014/04/18 18:10:29
Is the ordering of this call important? If not, I'
| |
192 return; | 194 return; |
195 } | |
193 | 196 |
194 if (m_loadingMainResource) { | 197 if (m_loadingMainResource) { |
195 // Stop the main resource loader and let it send the cancelled message. | 198 // Stop the main resource loader and let it send the cancelled message. |
196 cancelMainResourceLoad(ResourceError::cancelledError(m_request.url())); | 199 cancelMainResourceLoad(ResourceError::cancelledError(m_request.url())); |
197 } else if (m_fetcher->isFetching()) { | 200 } else if (m_fetcher->isFetching()) { |
198 // The main resource loader already finished loading. Set the cancelled error on the | 201 // The main resource loader already finished loading. Set the cancelled error on the |
199 // document and let the resourceLoaders send individual cancelled messag es below. | 202 // document and let the resourceLoaders send individual cancelled messag es below. |
200 setMainDocumentError(ResourceError::cancelledError(m_request.url())); | 203 setMainDocumentError(ResourceError::cancelledError(m_request.url())); |
201 } else { | 204 } else { |
202 // If there are no resource loaders, we need to manufacture a cancelled message. | 205 // If there are no resource loaders, we need to manufacture a cancelled message. |
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
828 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume nt) | 831 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume nt) |
829 { | 832 { |
830 m_frame->loader().stopAllLoaders(); | 833 m_frame->loader().stopAllLoaders(); |
831 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url( ), mimeType(), m_writer ? m_writer->encoding() : emptyAtom, m_writer ? m_writer ->encodingWasChosenByUser() : false, true); | 834 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url( ), mimeType(), m_writer ? m_writer->encoding() : emptyAtom, m_writer ? m_writer ->encodingWasChosenByUser() : false, true); |
832 if (!source.isNull()) | 835 if (!source.isNull()) |
833 m_writer->appendReplacingData(source); | 836 m_writer->appendReplacingData(source); |
834 endWriting(m_writer.get()); | 837 endWriting(m_writer.get()); |
835 } | 838 } |
836 | 839 |
837 } // namespace WebCore | 840 } // namespace WebCore |
OLD | NEW |