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

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

Issue 100563004: Redirect HTML resource bytes directly to parser thread (Blink side CL) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@parserthread_decodermove
Patch Set: Conflict fix Created 6 years, 8 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
« no previous file with comments | « Source/core/loader/DocumentLoader.h ('k') | public/platform/WebThreadedDataReceiver.h » ('j') | 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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
OLDNEW
« no previous file with comments | « Source/core/loader/DocumentLoader.h ('k') | public/platform/WebThreadedDataReceiver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698