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

Unified Diff: third_party/WebKit/Source/platform/exported/WebServiceWorkerStreamHandle.cpp

Issue 2703343002: ServiceWorker: Use mojo's data pipe for respondWith(stream) (Closed)
Patch Set: Addressed comments from kinuko and haraken 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/exported/WebServiceWorkerStreamHandle.cpp
diff --git a/third_party/WebKit/Source/platform/exported/WebServiceWorkerStreamHandle.cpp b/third_party/WebKit/Source/platform/exported/WebServiceWorkerStreamHandle.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..d08046c2f4ddcb5376b10cb79bd12255c625eda6
--- /dev/null
+++ b/third_party/WebKit/Source/platform/exported/WebServiceWorkerStreamHandle.cpp
@@ -0,0 +1,30 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "public/platform/modules/serviceworker/WebServiceWorkerStreamHandle.h"
+
+namespace blink {
+
+void WebServiceWorkerStreamHandle::SetListener(
+ std::unique_ptr<Listener> listener) {
+ DCHECK(!listener_);
+ listener_ = std::move(listener);
+}
+
+void WebServiceWorkerStreamHandle::Aborted() {
+ DCHECK(listener_);
+ listener_->OnAborted();
+}
+
+void WebServiceWorkerStreamHandle::Completed() {
+ DCHECK(listener_);
+ listener_->OnCompleted();
+}
+
+mojo::ScopedDataPipeConsumerHandle
+WebServiceWorkerStreamHandle::DrainStreamDataPipe() {
+ return std::move(stream_);
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698