| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 MojoLoader_h | 5 #ifndef MojoLoader_h |
| 6 #define MojoLoader_h | 6 #define MojoLoader_h |
| 7 | 7 |
| 8 #include "base/memory/weak_ptr.h" | |
| 9 #include "mojo/common/handle_watcher.h" | |
| 10 #include "mojo/public/cpp/system/data_pipe.h" | 8 #include "mojo/public/cpp/system/data_pipe.h" |
| 11 #include "platform/fetcher/DataPipeDrainer.h" | |
| 12 #include "platform/weborigin/KURL.h" | 9 #include "platform/weborigin/KURL.h" |
| 13 | 10 |
| 14 namespace blink { | 11 namespace blink { |
| 15 | 12 |
| 16 class LocalFrame; | 13 class LocalFrame; |
| 17 | 14 |
| 18 class MojoLoader : public DataPipeDrainer::Client { | 15 class MojoLoader { |
| 19 public: | 16 public: |
| 20 explicit MojoLoader(LocalFrame&); | 17 explicit MojoLoader(LocalFrame&); |
| 21 | 18 |
| 22 void load(const KURL&, mojo::ScopedDataPipeConsumerHandle); | 19 void load(const KURL&, mojo::ScopedDataPipeConsumerHandle); |
| 23 | 20 |
| 24 private: | 21 private: |
| 25 LocalFrame& m_frame; | 22 LocalFrame& m_frame; |
| 26 | |
| 27 // From DataPipeDrainer::Client | |
| 28 void OnDataAvailable(const void* data, size_t numberOfBytes) override; | |
| 29 void OnDataComplete() override; | |
| 30 | |
| 31 OwnPtr<DataPipeDrainer> m_drainJob; | |
| 32 }; | 23 }; |
| 33 | 24 |
| 34 } | 25 } |
| 35 | 26 |
| 36 #endif | 27 #endif |
| OLD | NEW |