| 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 { |
| 16 public: |
| 17 class Listener { |
| 18 public: |
| 19 virtual void OnAborted() = 0; |
| 20 virtual void OnCompleted() = 0; |
| 21 }; |
| 22 |
| 23 void SetListener(std::unique_ptr<Listener>); |
| 24 mojo::ScopedDataPipeConsumerHandle DrainStreamDataPipe(); |
| 25 |
| 26 #if INSIDE_BLINK |
| 27 WebServiceWorkerStreamHandle(mojo::ScopedDataPipeConsumerHandle stream) |
| 28 : stream_(std::move(stream)) {} |
| 29 void Aborted(); |
| 30 void Completed(); |
| 31 #endif |
| 32 |
| 33 private: |
| 34 mojo::ScopedDataPipeConsumerHandle stream_; |
| 35 std::unique_ptr<Listener> listener_; |
| 36 }; |
| 37 } |
| 38 |
| 39 #endif // WebServiceWorkerStreamHandle_h |
| OLD | NEW |