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

Side by Side Diff: Source/core/loader/DocumentLoader.cpp

Issue 23781008: Prevent crash in DocumentLoader::dataReceived (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Deflakify test Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « LayoutTests/fast/parser/xhtml-synchronous-detach-crash-expected.txt ('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) 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 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 602
603 commitIfReady(); 603 commitIfReady();
604 if (!frameLoader()) 604 if (!frameLoader())
605 return; 605 return;
606 if (isArchiveMIMEType(response().mimeType())) 606 if (isArchiveMIMEType(response().mimeType()))
607 return; 607 return;
608 commitData(data, length); 608 commitData(data, length);
609 609
610 // If we are sending data to MediaDocument, we should stop here 610 // If we are sending data to MediaDocument, we should stop here
611 // and cancel the request. 611 // and cancel the request.
612 if (m_frame->document()->isMediaDocument()) 612 if (m_frame && m_frame->document()->isMediaDocument())
613 cancelMainResourceLoad(ResourceError::cancelledError(m_request.url())); 613 cancelMainResourceLoad(ResourceError::cancelledError(m_request.url()));
614 } 614 }
615 615
616 void DocumentLoader::checkLoadComplete() 616 void DocumentLoader::checkLoadComplete()
617 { 617 {
618 if (!m_frame || isLoading()) 618 if (!m_frame || isLoading())
619 return; 619 return;
620 // FIXME: This ASSERT is always triggered. 620 // FIXME: This ASSERT is always triggered.
621 // See https://bugs.webkit.org/show_bug.cgi?id=110937 621 // See https://bugs.webkit.org/show_bug.cgi?id=110937
622 // ASSERT(this == frameLoader()->activeDocumentLoader()) 622 // ASSERT(this == frameLoader()->activeDocumentLoader())
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume nt) 941 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume nt)
942 { 942 {
943 m_frame->loader()->stopAllLoaders(); 943 m_frame->loader()->stopAllLoaders();
944 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url( ), mimeType(), m_writer ? m_writer->encoding() : "", m_writer ? m_writer->encod ingWasChosenByUser() : false, true); 944 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url( ), mimeType(), m_writer ? m_writer->encoding() : "", m_writer ? m_writer->encod ingWasChosenByUser() : false, true);
945 if (!source.isNull()) 945 if (!source.isNull())
946 m_writer->appendReplacingData(source); 946 m_writer->appendReplacingData(source);
947 endWriting(m_writer.get()); 947 endWriting(m_writer.get());
948 } 948 }
949 949
950 } // namespace WebCore 950 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/parser/xhtml-synchronous-detach-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698