Chromium Code Reviews| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 53 #include "core/frame/Settings.h" | 53 #include "core/frame/Settings.h" |
| 54 #include "platform/Logging.h" | 54 #include "platform/Logging.h" |
| 55 #include "platform/UserGestureIndicator.h" | 55 #include "platform/UserGestureIndicator.h" |
| 56 #include "platform/mhtml/ArchiveResourceCollection.h" | 56 #include "platform/mhtml/ArchiveResourceCollection.h" |
| 57 #include "platform/mhtml/MHTMLArchive.h" | 57 #include "platform/mhtml/MHTMLArchive.h" |
| 58 #include "platform/plugins/PluginData.h" | 58 #include "platform/plugins/PluginData.h" |
| 59 #include "platform/weborigin/SchemeRegistry.h" | 59 #include "platform/weborigin/SchemeRegistry.h" |
| 60 #include "platform/weborigin/SecurityPolicy.h" | 60 #include "platform/weborigin/SecurityPolicy.h" |
| 61 #include "public/platform/Platform.h" | 61 #include "public/platform/Platform.h" |
| 62 #include "public/platform/WebMimeRegistry.h" | 62 #include "public/platform/WebMimeRegistry.h" |
| 63 #include "public/platform/WebParserResourceBridge.h" | |
| 63 #include "wtf/Assertions.h" | 64 #include "wtf/Assertions.h" |
| 64 #include "wtf/text/WTFString.h" | 65 #include "wtf/text/WTFString.h" |
| 65 | 66 |
| 66 namespace WebCore { | 67 namespace WebCore { |
| 67 | 68 |
| 68 static bool isArchiveMIMEType(const String& mimeType) | 69 static bool isArchiveMIMEType(const String& mimeType) |
| 69 { | 70 { |
| 70 return mimeType == "multipart/related"; | 71 return mimeType == "multipart/related"; |
| 71 } | 72 } |
| 72 | 73 |
| (...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 612 if (isArchiveMIMEType(response().mimeType())) | 613 if (isArchiveMIMEType(response().mimeType())) |
| 613 return; | 614 return; |
| 614 commitData(data, length); | 615 commitData(data, length); |
| 615 | 616 |
| 616 // If we are sending data to MediaDocument, we should stop here | 617 // If we are sending data to MediaDocument, we should stop here |
| 617 // and cancel the request. | 618 // and cancel the request. |
| 618 if (m_frame && m_frame->document()->isMediaDocument()) | 619 if (m_frame && m_frame->document()->isMediaDocument()) |
| 619 cancelMainResourceLoad(ResourceError::cancelledError(m_request.url())); | 620 cancelMainResourceLoad(ResourceError::cancelledError(m_request.url())); |
| 620 } | 621 } |
| 621 | 622 |
| 623 void DocumentLoader::parserResourceMessageFilterAdded(Resource* resource) | |
| 624 { | |
| 625 ASSERT_UNUSED(resource, resource == m_mainResource); | |
| 626 m_writer->parserResourceMessageFilterAdded(); | |
| 627 } | |
| 628 | |
| 622 void DocumentLoader::checkLoadComplete() | 629 void DocumentLoader::checkLoadComplete() |
| 623 { | 630 { |
| 624 if (!m_frame || isLoading()) | 631 if (!m_frame || isLoading()) |
| 625 return; | 632 return; |
| 626 // FIXME: This ASSERT is always triggered. | 633 // FIXME: This ASSERT is always triggered. |
| 627 // See https://bugs.webkit.org/show_bug.cgi?id=110937 | 634 // See https://bugs.webkit.org/show_bug.cgi?id=110937 |
| 628 // ASSERT(this == frameLoader()->activeDocumentLoader()) | 635 // ASSERT(this == frameLoader()->activeDocumentLoader()) |
| 629 m_frame->domWindow()->finishedLoading(); | 636 m_frame->domWindow()->finishedLoading(); |
| 630 } | 637 } |
| 631 | 638 |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 872 RefPtr<DocumentLoader> protect(this); | 879 RefPtr<DocumentLoader> protect(this); |
| 873 ResourceError error = resourceError.isNull() ? ResourceError::cancelledError (m_request.url()) : resourceError; | 880 ResourceError error = resourceError.isNull() ? ResourceError::cancelledError (m_request.url()) : resourceError; |
| 874 | 881 |
| 875 m_dataLoadTimer.stop(); | 882 m_dataLoadTimer.stop(); |
| 876 if (mainResourceLoader()) | 883 if (mainResourceLoader()) |
| 877 mainResourceLoader()->cancel(error); | 884 mainResourceLoader()->cancel(error); |
| 878 | 885 |
| 879 mainReceivedError(error); | 886 mainReceivedError(error); |
| 880 } | 887 } |
| 881 | 888 |
| 889 PassOwnPtr<blink::WebParserResourceBridge> DocumentLoader::constructParserResour ceBridge() | |
| 890 { | |
| 891 if (mainResourceLoader()) | |
| 892 return mainResourceLoader()->constructParserResourceBridge(); | |
| 893 | |
| 894 return OwnPtr<blink::WebParserResourceBridge>().release(); | |
|
abarth-chromium
2013/12/18 18:28:49
return nullptr;
| |
| 895 } | |
| 896 | |
| 882 DocumentWriter* DocumentLoader::beginWriting(const AtomicString& mimeType, const AtomicString& encoding, const KURL& url) | 897 DocumentWriter* DocumentLoader::beginWriting(const AtomicString& mimeType, const AtomicString& encoding, const KURL& url) |
| 883 { | 898 { |
| 884 m_writer = createWriterFor(m_frame, 0, url, mimeType, encoding, false, true) ; | 899 m_writer = createWriterFor(m_frame, 0, url, mimeType, encoding, false, true) ; |
| 885 return m_writer.get(); | 900 return m_writer.get(); |
| 886 } | 901 } |
| 887 | 902 |
| 888 void DocumentLoader::endWriting(DocumentWriter* writer) | 903 void DocumentLoader::endWriting(DocumentWriter* writer) |
| 889 { | 904 { |
| 890 ASSERT_UNUSED(writer, m_writer == writer); | 905 ASSERT_UNUSED(writer, m_writer == writer); |
| 891 m_writer->end(); | 906 m_writer->end(); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 948 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume nt) | 963 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume nt) |
| 949 { | 964 { |
| 950 m_frame->loader().stopAllLoaders(); | 965 m_frame->loader().stopAllLoaders(); |
| 951 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url( ), mimeType(), m_writer ? m_writer->encoding() : emptyAtom, m_writer ? m_writer ->encodingWasChosenByUser() : false, true); | 966 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url( ), mimeType(), m_writer ? m_writer->encoding() : emptyAtom, m_writer ? m_writer ->encodingWasChosenByUser() : false, true); |
| 952 if (!source.isNull()) | 967 if (!source.isNull()) |
| 953 m_writer->appendReplacingData(source); | 968 m_writer->appendReplacingData(source); |
| 954 endWriting(m_writer.get()); | 969 endWriting(m_writer.get()); |
| 955 } | 970 } |
| 956 | 971 |
| 957 } // namespace WebCore | 972 } // namespace WebCore |
| OLD | NEW |