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

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

Issue 690793003: Threaded data provider: Support main thread data notifications (Blink side) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review fixes Created 5 years, 11 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
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 771 matching lines...) Expand 10 before | Expand all | Expand 10 after
782 782
783 mainReceivedError(error); 783 mainReceivedError(error);
784 } 784 }
785 785
786 void DocumentLoader::attachThreadedDataReceiver(PassOwnPtr<blink::WebThreadedDat aReceiver> threadedDataReceiver) 786 void DocumentLoader::attachThreadedDataReceiver(PassOwnPtr<blink::WebThreadedDat aReceiver> threadedDataReceiver)
787 { 787 {
788 if (mainResourceLoader()) 788 if (mainResourceLoader())
789 mainResourceLoader()->attachThreadedDataReceiver(threadedDataReceiver); 789 mainResourceLoader()->attachThreadedDataReceiver(threadedDataReceiver);
790 } 790 }
791 791
792 void DocumentLoader::acceptDataFromThreadedReceiver(const char* data, int dataLe ngth, int encodedDataLength)
793 {
794 m_fetcher->acceptDataFromThreadedReceiver(mainResourceIdentifier(), data, da taLength, encodedDataLength);
795 }
796
792 void DocumentLoader::endWriting(DocumentWriter* writer) 797 void DocumentLoader::endWriting(DocumentWriter* writer)
793 { 798 {
794 ASSERT_UNUSED(writer, m_writer == writer); 799 ASSERT_UNUSED(writer, m_writer == writer);
795 m_writer->end(); 800 m_writer->end();
796 m_writer.clear(); 801 m_writer.clear();
797 } 802 }
798 803
799 PassRefPtrWillBeRawPtr<DocumentWriter> DocumentLoader::createWriterFor(const Doc ument* ownerDocument, const DocumentInit& init, const AtomicString& mimeType, co nst AtomicString& encoding, bool dispatch, ParserSynchronizationPolicy parsingPo licy) 804 PassRefPtrWillBeRawPtr<DocumentWriter> DocumentLoader::createWriterFor(const Doc ument* ownerDocument, const DocumentInit& init, const AtomicString& mimeType, co nst AtomicString& encoding, bool dispatch, ParserSynchronizationPolicy parsingPo licy)
800 { 805 {
801 LocalFrame* frame = init.frame(); 806 LocalFrame* frame = init.frame();
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 // This is only called by FrameLoader::replaceDocumentWhileExecutingJavaScriptUR L() 840 // This is only called by FrameLoader::replaceDocumentWhileExecutingJavaScriptUR L()
836 void DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL(const DocumentIn it& init, const String& source, Document* ownerDocument) 841 void DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL(const DocumentIn it& init, const String& source, Document* ownerDocument)
837 { 842 {
838 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri ter->encoding() : emptyAtom, true, ForceSynchronousParsing); 843 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri ter->encoding() : emptyAtom, true, ForceSynchronousParsing);
839 if (!source.isNull()) 844 if (!source.isNull())
840 m_writer->appendReplacingData(source); 845 m_writer->appendReplacingData(source);
841 endWriting(m_writer.get()); 846 endWriting(m_writer.get());
842 } 847 }
843 848
844 } // namespace blink 849 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698