| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef DataConsumerTee_h | 5 #ifndef DataConsumerTee_h |
| 6 #define DataConsumerTee_h | 6 #define DataConsumerTee_h |
| 7 | 7 |
| 8 #include "modules/ModulesExport.h" | 8 #include "modules/ModulesExport.h" |
| 9 #include "modules/fetch/FetchDataConsumerHandle.h" | 9 #include "modules/fetch/FetchDataConsumerHandle.h" |
| 10 #include "public/platform/WebDataConsumerHandle.h" | 10 #include "public/platform/WebDataConsumerHandle.h" |
| 11 #include "wtf/Allocator.h" | 11 #include "wtf/Allocator.h" |
| 12 #include "wtf/OwnPtr.h" | 12 #include <memory> |
| 13 #include "wtf/PassOwnPtr.h" | |
| 14 | 13 |
| 15 namespace blink { | 14 namespace blink { |
| 16 | 15 |
| 17 class ExecutionContext; | 16 class ExecutionContext; |
| 18 | 17 |
| 19 class MODULES_EXPORT DataConsumerTee { | 18 class MODULES_EXPORT DataConsumerTee { |
| 20 STATIC_ONLY(DataConsumerTee); | 19 STATIC_ONLY(DataConsumerTee); |
| 21 public: | 20 public: |
| 22 // Create two handles from one. |src| must be a valid unlocked handle. | 21 // Create two handles from one. |src| must be a valid unlocked handle. |
| 23 static void create(ExecutionContext*, PassOwnPtr<WebDataConsumerHandle> src,
OwnPtr<WebDataConsumerHandle>* dest1, OwnPtr<WebDataConsumerHandle>* dest2); | 22 static void create(ExecutionContext*, std::unique_ptr<WebDataConsumerHandle>
src, std::unique_ptr<WebDataConsumerHandle>* dest1, std::unique_ptr<WebDataCons
umerHandle>* dest2); |
| 24 static void create(ExecutionContext*, PassOwnPtr<FetchDataConsumerHandle> sr
c, OwnPtr<FetchDataConsumerHandle>* dest1, OwnPtr<FetchDataConsumerHandle>* dest
2); | 23 static void create(ExecutionContext*, std::unique_ptr<FetchDataConsumerHandl
e> src, std::unique_ptr<FetchDataConsumerHandle>* dest1, std::unique_ptr<FetchDa
taConsumerHandle>* dest2); |
| 25 }; | 24 }; |
| 26 | 25 |
| 27 } // namespace blink | 26 } // namespace blink |
| 28 | 27 |
| 29 #endif // DataConsumerTee_h | 28 #endif // DataConsumerTee_h |
| OLD | NEW |