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

Side by Side Diff: third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp

Issue 2703343002: ServiceWorker: Use mojo's data pipe for respondWith(stream) (Closed)
Patch Set: Used TEST_P to test closing the connection first and On{Aborted,Completed} first Created 3 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/fetch/BodyStreamBuffer.h" 5 #include "modules/fetch/BodyStreamBuffer.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include "bindings/core/v8/ScriptState.h" 8 #include "bindings/core/v8/ScriptState.h"
9 #include "bindings/core/v8/V8PrivateProperty.h" 9 #include "bindings/core/v8/V8PrivateProperty.h"
10 #include "bindings/core/v8/V8ThrowException.h" 10 #include "bindings/core/v8/V8ThrowException.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 void didFetchDataLoadedArrayBuffer(DOMArrayBuffer* arrayBuffer) override { 44 void didFetchDataLoadedArrayBuffer(DOMArrayBuffer* arrayBuffer) override {
45 m_buffer->endLoading(); 45 m_buffer->endLoading();
46 m_client->didFetchDataLoadedArrayBuffer(arrayBuffer); 46 m_client->didFetchDataLoadedArrayBuffer(arrayBuffer);
47 } 47 }
48 48
49 void didFetchDataLoadedString(const String& string) override { 49 void didFetchDataLoadedString(const String& string) override {
50 m_buffer->endLoading(); 50 m_buffer->endLoading();
51 m_client->didFetchDataLoadedString(string); 51 m_client->didFetchDataLoadedString(string);
52 } 52 }
53 53
54 void didFetchDataLoadedStream() override { 54 void didFetchDataLoadedDataPipe() override {
55 m_buffer->endLoading(); 55 m_buffer->endLoading();
56 m_client->didFetchDataLoadedStream(); 56 m_client->didFetchDataLoadedDataPipe();
57 } 57 }
58 58
59 void didFetchDataLoadFailed() override { 59 void didFetchDataLoadFailed() override {
60 m_buffer->endLoading(); 60 m_buffer->endLoading();
61 m_client->didFetchDataLoadFailed(); 61 m_client->didFetchDataLoadFailed();
62 } 62 }
63 63
64 DEFINE_INLINE_TRACE() { 64 DEFINE_INLINE_TRACE() {
65 visitor->trace(m_buffer); 65 visitor->trace(m_buffer);
66 visitor->trace(m_client); 66 visitor->trace(m_client);
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 } 381 }
382 if (isErrored) 382 if (isErrored)
383 return BytesConsumer::createErrored(BytesConsumer::Error("error")); 383 return BytesConsumer::createErrored(BytesConsumer::Error("error"));
384 384
385 DCHECK(consumer); 385 DCHECK(consumer);
386 consumer->clearClient(); 386 consumer->clearClient();
387 return consumer; 387 return consumer;
388 } 388 }
389 389
390 } // namespace blink 390 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698