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

Unified Diff: third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerStreamHandle.h

Issue 2703343002: ServiceWorker: Use mojo's data pipe for respondWith(stream) (Closed)
Patch Set: IFRAME_URL -> SCOPE 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/public/platform/modules/serviceworker/WebServiceWorkerStreamHandle.h
diff --git a/third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerStreamHandle.h b/third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerStreamHandle.h
new file mode 100644
index 0000000000000000000000000000000000000000..feebf074facf1953e18082996616f4fd0c27eb4e
--- /dev/null
+++ b/third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerStreamHandle.h
@@ -0,0 +1,40 @@
+// 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.
+
+#ifndef WebServiceWorkerStreamHandle_h
+#define WebServiceWorkerStreamHandle_h
+
+#include <memory>
+
+#include "mojo/public/cpp/system/data_pipe.h"
+#include "public/platform/WebCommon.h"
+
+namespace blink {
+
+class BLINK_PLATFORM_EXPORT WebServiceWorkerStreamHandle {
kinuko 2017/04/13 02:22:27 I'm probably missing something but do we need this
haraken 2017/04/13 05:03:44 Yeah, also I think it's worth thinking about remov
shimazu 2017/04/18 01:50:05 I totally agree that it's better if we can remove
haraken 2017/04/18 11:41:18 I'm not sure if I understand the background but wo
shimazu 2017/04/19 05:49:46 Yes, I don't think it's easy because we should mov
haraken 2017/04/19 09:14:30 If it's hard, I'm okay with proceeding with this C
+ public:
+ class Listener {
+ public:
+ virtual ~Listener(){};
+ virtual void OnAborted() = 0;
+ virtual void OnCompleted() = 0;
+ };
+
+ void SetListener(std::unique_ptr<Listener>);
+ mojo::ScopedDataPipeConsumerHandle DrainStreamDataPipe();
+
+#if INSIDE_BLINK
+ WebServiceWorkerStreamHandle(mojo::ScopedDataPipeConsumerHandle stream)
+ : stream_(std::move(stream)) {}
+ void Aborted();
+ void Completed();
+#endif
+
+ private:
+ mojo::ScopedDataPipeConsumerHandle stream_;
+ std::unique_ptr<Listener> listener_;
+};
+}
+
+#endif // WebServiceWorkerStreamHandle_h

Powered by Google App Engine
This is Rietveld 408576698