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/WebThreadedResourceProvider.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 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 { | 778 { |
778 RefPtr<DocumentLoader> protect(this); | 779 RefPtr<DocumentLoader> protect(this); |
779 ResourceError error = resourceError.isNull() ? ResourceError::cancelledError
(m_request.url()) : resourceError; | 780 ResourceError error = resourceError.isNull() ? ResourceError::cancelledError
(m_request.url()) : resourceError; |
780 | 781 |
781 if (mainResourceLoader()) | 782 if (mainResourceLoader()) |
782 mainResourceLoader()->cancel(error); | 783 mainResourceLoader()->cancel(error); |
783 | 784 |
784 mainReceivedError(error); | 785 mainReceivedError(error); |
785 } | 786 } |
786 | 787 |
| 788 PassOwnPtr<blink::WebThreadedResourceProvider> DocumentLoader::createThreadedRes
ourceProvider() |
| 789 { |
| 790 if (mainResourceLoader()) |
| 791 return mainResourceLoader()->createThreadedResourceProvider(); |
| 792 |
| 793 return nullptr; |
| 794 } |
| 795 |
787 void DocumentLoader::endWriting(DocumentWriter* writer) | 796 void DocumentLoader::endWriting(DocumentWriter* writer) |
788 { | 797 { |
789 ASSERT_UNUSED(writer, m_writer == writer); | 798 ASSERT_UNUSED(writer, m_writer == writer); |
790 m_writer->end(); | 799 m_writer->end(); |
791 m_writer.clear(); | 800 m_writer.clear(); |
792 } | 801 } |
793 | 802 |
794 PassRefPtr<DocumentWriter> DocumentLoader::createWriterFor(Frame* frame, const D
ocument* ownerDocument, const KURL& url, const AtomicString& mimeType, const Ato
micString& encoding, bool userChosen, bool dispatch) | 803 PassRefPtr<DocumentWriter> DocumentLoader::createWriterFor(Frame* frame, const D
ocument* ownerDocument, const KURL& url, const AtomicString& mimeType, const Ato
micString& encoding, bool userChosen, bool dispatch) |
795 { | 804 { |
796 // Create a new document before clearing the frame, because it may need to | 805 // 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... |
845 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume
nt) | 854 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume
nt) |
846 { | 855 { |
847 m_frame->loader().stopAllLoaders(); | 856 m_frame->loader().stopAllLoaders(); |
848 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url(
), mimeType(), m_writer ? m_writer->encoding() : emptyAtom, m_writer ? m_writer
->encodingWasChosenByUser() : false, true); | 857 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url(
), mimeType(), m_writer ? m_writer->encoding() : emptyAtom, m_writer ? m_writer
->encodingWasChosenByUser() : false, true); |
849 if (!source.isNull()) | 858 if (!source.isNull()) |
850 m_writer->appendReplacingData(source); | 859 m_writer->appendReplacingData(source); |
851 endWriting(m_writer.get()); | 860 endWriting(m_writer.get()); |
852 } | 861 } |
853 | 862 |
854 } // namespace WebCore | 863 } // namespace WebCore |
OLD | NEW |