| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 #include "core/frame/Settings.h" | 52 #include "core/frame/Settings.h" |
| 53 #include "platform/Logging.h" | 53 #include "platform/Logging.h" |
| 54 #include "platform/UserGestureIndicator.h" | 54 #include "platform/UserGestureIndicator.h" |
| 55 #include "platform/mhtml/ArchiveResourceCollection.h" | 55 #include "platform/mhtml/ArchiveResourceCollection.h" |
| 56 #include "platform/mhtml/MHTMLArchive.h" | 56 #include "platform/mhtml/MHTMLArchive.h" |
| 57 #include "platform/plugins/PluginData.h" | 57 #include "platform/plugins/PluginData.h" |
| 58 #include "platform/weborigin/SchemeRegistry.h" | 58 #include "platform/weborigin/SchemeRegistry.h" |
| 59 #include "platform/weborigin/SecurityPolicy.h" | 59 #include "platform/weborigin/SecurityPolicy.h" |
| 60 #include "public/platform/Platform.h" | 60 #include "public/platform/Platform.h" |
| 61 #include "public/platform/WebMimeRegistry.h" | 61 #include "public/platform/WebMimeRegistry.h" |
| 62 #include "public/platform/WebThreadedDataReceiver.h" |
| 62 #include "wtf/Assertions.h" | 63 #include "wtf/Assertions.h" |
| 63 #include "wtf/text/WTFString.h" | 64 #include "wtf/text/WTFString.h" |
| 64 | 65 |
| 65 namespace WebCore { | 66 namespace WebCore { |
| 66 | 67 |
| 67 static bool isArchiveMIMEType(const String& mimeType) | 68 static bool isArchiveMIMEType(const String& mimeType) |
| 68 { | 69 { |
| 69 return mimeType == "multipart/related"; | 70 return mimeType == "multipart/related"; |
| 70 } | 71 } |
| 71 | 72 |
| (...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 753 { | 754 { |
| 754 RefPtr<DocumentLoader> protect(this); | 755 RefPtr<DocumentLoader> protect(this); |
| 755 ResourceError error = resourceError.isNull() ? ResourceError::cancelledError
(m_request.url()) : resourceError; | 756 ResourceError error = resourceError.isNull() ? ResourceError::cancelledError
(m_request.url()) : resourceError; |
| 756 | 757 |
| 757 if (mainResourceLoader()) | 758 if (mainResourceLoader()) |
| 758 mainResourceLoader()->cancel(error); | 759 mainResourceLoader()->cancel(error); |
| 759 | 760 |
| 760 mainReceivedError(error); | 761 mainReceivedError(error); |
| 761 } | 762 } |
| 762 | 763 |
| 764 void DocumentLoader::attachThreadedDataReceiver(PassOwnPtr<blink::WebThreadedDat
aReceiver> threadedDataReceiver) |
| 765 { |
| 766 if (mainResourceLoader()) |
| 767 mainResourceLoader()->attachThreadedDataReceiver(threadedDataReceiver); |
| 768 } |
| 769 |
| 763 void DocumentLoader::endWriting(DocumentWriter* writer) | 770 void DocumentLoader::endWriting(DocumentWriter* writer) |
| 764 { | 771 { |
| 765 ASSERT_UNUSED(writer, m_writer == writer); | 772 ASSERT_UNUSED(writer, m_writer == writer); |
| 766 m_writer->end(); | 773 m_writer->end(); |
| 767 m_writer.clear(); | 774 m_writer.clear(); |
| 768 } | 775 } |
| 769 | 776 |
| 770 PassRefPtr<DocumentWriter> DocumentLoader::createWriterFor(LocalFrame* frame, co
nst Document* ownerDocument, const KURL& url, const AtomicString& mimeType, cons
t AtomicString& encoding, bool userChosen, bool dispatch) | 777 PassRefPtr<DocumentWriter> DocumentLoader::createWriterFor(LocalFrame* frame, co
nst Document* ownerDocument, const KURL& url, const AtomicString& mimeType, cons
t AtomicString& encoding, bool userChosen, bool dispatch) |
| 771 { | 778 { |
| 772 // Create a new document before clearing the frame, because it may need to | 779 // 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... |
| 821 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume
nt) | 828 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume
nt) |
| 822 { | 829 { |
| 823 m_frame->loader().stopAllLoaders(); | 830 m_frame->loader().stopAllLoaders(); |
| 824 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url(
), mimeType(), m_writer ? m_writer->encoding() : emptyAtom, m_writer ? m_writer
->encodingWasChosenByUser() : false, true); | 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); |
| 825 if (!source.isNull()) | 832 if (!source.isNull()) |
| 826 m_writer->appendReplacingData(source); | 833 m_writer->appendReplacingData(source); |
| 827 endWriting(m_writer.get()); | 834 endWriting(m_writer.get()); |
| 828 } | 835 } |
| 829 | 836 |
| 830 } // namespace WebCore | 837 } // namespace WebCore |
| OLD | NEW |