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

Unified Diff: Source/core/xmlhttprequest/XMLHttpRequest.cpp

Issue 1163653005: Remove deprecated APIs from WebDataConsumerHandle. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@reader-interface
Patch Set: Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | public/platform/WebDataConsumerHandle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/xmlhttprequest/XMLHttpRequest.cpp
diff --git a/Source/core/xmlhttprequest/XMLHttpRequest.cpp b/Source/core/xmlhttprequest/XMLHttpRequest.cpp
index c700871d5e1f951d57cf282a7f6bdb3fe44aef48..aebbed55feeba564afe15dbc871528e88cef1202 100644
--- a/Source/core/xmlhttprequest/XMLHttpRequest.cpp
+++ b/Source/core/xmlhttprequest/XMLHttpRequest.cpp
@@ -161,7 +161,7 @@ public:
if (m_body) {
// |m_body| has |this| as a raw pointer, but it is not a problem
// because |this| owns |m_body|.
- m_body->registerClient(this);
+ m_reader = m_body->obtainReader(this);
}
}
~ReadableStreamSource() override { }
@@ -229,7 +229,7 @@ private:
while (m_needsMore) {
const void* buffer = nullptr;
size_t size = 0;
- Result result = m_body->beginRead(&buffer, WebDataConsumerHandle::FlagNone, &size);
+ Result result = m_reader->beginRead(&buffer, WebDataConsumerHandle::FlagNone, &size);
if (result == WebDataConsumerHandle::ShouldWait)
return;
if (result == WebDataConsumerHandle::Done) {
@@ -252,7 +252,7 @@ private:
}
RefPtr<DOMArrayBuffer> arrayBuffer = DOMArrayBuffer::create(size, 1);
memcpy(arrayBuffer->data(), buffer, size);
- result = m_body->endRead(size);
+ result = m_reader->endRead(size);
if (result != WebDataConsumerHandle::Ok) {
m_stream->error(DOMException::create(NetworkError));
m_owner->abort();
@@ -269,6 +269,7 @@ private:
RawPtrWillBeMember<XMLHttpRequest> m_owner;
Member<ReadableStreamImpl<ReadableStreamChunkTypeTraits<DOMArrayBufferView>>> m_stream;
OwnPtr<WebDataConsumerHandle> m_body;
+ OwnPtr<WebDataConsumerHandle::Reader> m_reader;
bool m_needsMore;
bool m_hasReadBody;
bool m_hasGotDidFinishLoading;
« no previous file with comments | « no previous file | public/platform/WebDataConsumerHandle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698