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 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
773 { | 773 { |
774 RefPtr<DocumentLoader> protect(this); | 774 RefPtr<DocumentLoader> protect(this); |
775 ResourceError error = resourceError.isNull() ? ResourceError::cancelledError (m_request.url()) : resourceError; | 775 ResourceError error = resourceError.isNull() ? ResourceError::cancelledError (m_request.url()) : resourceError; |
776 | 776 |
777 if (mainResourceLoader()) | 777 if (mainResourceLoader()) |
778 mainResourceLoader()->cancel(error); | 778 mainResourceLoader()->cancel(error); |
779 | 779 |
780 mainReceivedError(error); | 780 mainReceivedError(error); |
781 } | 781 } |
782 | 782 |
783 void DocumentLoader::attachThreadedDataReceiver(blink::WebThreadedDataReceiver* threadedDataReceiver) | |
784 { | |
785 if (mainResourceLoader()) | |
abarth-chromium
2014/03/10 21:52:20
Should it be an error to call this function withou
| |
786 mainResourceLoader()->attachThreadedDataReceiver(threadedDataReceiver); | |
787 } | |
788 | |
783 void DocumentLoader::endWriting(DocumentWriter* writer) | 789 void DocumentLoader::endWriting(DocumentWriter* writer) |
784 { | 790 { |
785 ASSERT_UNUSED(writer, m_writer == writer); | 791 ASSERT_UNUSED(writer, m_writer == writer); |
786 m_writer->end(); | 792 m_writer->end(); |
787 m_writer.clear(); | 793 m_writer.clear(); |
788 } | 794 } |
789 | 795 |
790 PassRefPtr<DocumentWriter> DocumentLoader::createWriterFor(LocalFrame* frame, co nst Document* ownerDocument, const KURL& url, const AtomicString& mimeType, cons t AtomicString& encoding, bool userChosen, bool dispatch) | 796 PassRefPtr<DocumentWriter> DocumentLoader::createWriterFor(LocalFrame* frame, co nst Document* ownerDocument, const KURL& url, const AtomicString& mimeType, cons t AtomicString& encoding, bool userChosen, bool dispatch) |
791 { | 797 { |
792 // Create a new document before clearing the frame, because it may need to | 798 // Create a new document before clearing the frame, because it may need to |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
841 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume nt) | 847 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume nt) |
842 { | 848 { |
843 m_frame->loader().stopAllLoaders(); | 849 m_frame->loader().stopAllLoaders(); |
844 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url( ), mimeType(), m_writer ? m_writer->encoding() : emptyAtom, m_writer ? m_writer ->encodingWasChosenByUser() : false, true); | 850 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url( ), mimeType(), m_writer ? m_writer->encoding() : emptyAtom, m_writer ? m_writer ->encodingWasChosenByUser() : false, true); |
845 if (!source.isNull()) | 851 if (!source.isNull()) |
846 m_writer->appendReplacingData(source); | 852 m_writer->appendReplacingData(source); |
847 endWriting(m_writer.get()); | 853 endWriting(m_writer.get()); |
848 } | 854 } |
849 | 855 |
850 } // namespace WebCore | 856 } // namespace WebCore |
OLD | NEW |