Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef WebServiceWorkerStreamHandle_h | |
| 6 #define WebServiceWorkerStreamHandle_h | |
| 7 | |
| 8 #include <memory> | |
| 9 | |
| 10 #include "mojo/public/cpp/system/data_pipe.h" | |
| 11 #include "public/platform/WebCommon.h" | |
| 12 | |
| 13 namespace blink { | |
| 14 | |
| 15 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
| |
| 16 public: | |
| 17 class Listener { | |
| 18 public: | |
| 19 virtual ~Listener(){}; | |
| 20 virtual void OnAborted() = 0; | |
| 21 virtual void OnCompleted() = 0; | |
| 22 }; | |
| 23 | |
| 24 void SetListener(std::unique_ptr<Listener>); | |
| 25 mojo::ScopedDataPipeConsumerHandle DrainStreamDataPipe(); | |
| 26 | |
| 27 #if INSIDE_BLINK | |
| 28 WebServiceWorkerStreamHandle(mojo::ScopedDataPipeConsumerHandle stream) | |
| 29 : stream_(std::move(stream)) {} | |
| 30 void Aborted(); | |
| 31 void Completed(); | |
| 32 #endif | |
| 33 | |
| 34 private: | |
| 35 mojo::ScopedDataPipeConsumerHandle stream_; | |
| 36 std::unique_ptr<Listener> listener_; | |
| 37 }; | |
| 38 } | |
| 39 | |
| 40 #endif // WebServiceWorkerStreamHandle_h | |
| OLD | NEW |