Chromium Code Reviews| 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 { | 
| 
 
falken
2017/04/18 05:05:34
nit document this class and the public Listener in
 
shimazu
2017/04/19 05:49:47
Done.
 
 | 
| + 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 |