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

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: Directly call InspectorInstrumentation::hasFrontends Created 6 years, 1 month 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 772 matching lines...) Expand 10 before | Expand all | Expand 10 after
783 783
784 mainReceivedError(error); 784 mainReceivedError(error);
785 } 785 }
786 786
787 void DocumentLoader::attachThreadedDataReceiver(PassOwnPtr<blink::WebThreadedDat aReceiver> threadedDataReceiver) 787 void DocumentLoader::attachThreadedDataReceiver(PassOwnPtr<blink::WebThreadedDat aReceiver> threadedDataReceiver)
788 { 788 {
789 if (mainResourceLoader()) 789 if (mainResourceLoader())
790 mainResourceLoader()->attachThreadedDataReceiver(threadedDataReceiver); 790 mainResourceLoader()->attachThreadedDataReceiver(threadedDataReceiver);
791 } 791 }
792 792
793 void DocumentLoader::acceptDataFromThreadedReceiver(const char* data, int dataLe ngth, int encodedDataLength)
794 {
795 m_fetcher->acceptDataFromThreadedReceiver(mainResourceIdentifier(), data, da taLength, encodedDataLength);
796 }
797
793 void DocumentLoader::endWriting(DocumentWriter* writer) 798 void DocumentLoader::endWriting(DocumentWriter* writer)
794 { 799 {
795 ASSERT_UNUSED(writer, m_writer == writer); 800 ASSERT_UNUSED(writer, m_writer == writer);
796 m_writer->end(); 801 m_writer->end();
797 m_writer.clear(); 802 m_writer.clear();
798 } 803 }
799 804
800 PassRefPtrWillBeRawPtr<DocumentWriter> DocumentLoader::createWriterFor(const Doc ument* ownerDocument, const DocumentInit& init, const AtomicString& mimeType, co nst AtomicString& encoding, bool dispatch) 805 PassRefPtrWillBeRawPtr<DocumentWriter> DocumentLoader::createWriterFor(const Doc ument* ownerDocument, const DocumentInit& init, const AtomicString& mimeType, co nst AtomicString& encoding, bool dispatch)
801 { 806 {
802 LocalFrame* frame = init.frame(); 807 LocalFrame* frame = init.frame();
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 // This is only called by FrameLoader::replaceDocumentWhileExecutingJavaScriptUR L() 841 // This is only called by FrameLoader::replaceDocumentWhileExecutingJavaScriptUR L()
837 void DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL(const DocumentIn it& init, const String& source, Document* ownerDocument) 842 void DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL(const DocumentIn it& init, const String& source, Document* ownerDocument)
838 { 843 {
839 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri ter->encoding() : emptyAtom, true); 844 m_writer = createWriterFor(ownerDocument, init, mimeType(), m_writer ? m_wri ter->encoding() : emptyAtom, true);
840 if (!source.isNull()) 845 if (!source.isNull())
841 m_writer->appendReplacingData(source); 846 m_writer->appendReplacingData(source);
842 endWriting(m_writer.get()); 847 endWriting(m_writer.get());
843 } 848 }
844 849
845 } // namespace blink 850 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698