| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 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 BLIMP_ENGINE_MOJO_BLOB_CHANNEL_SERVICE_H_ |
| 6 #define BLIMP_ENGINE_MOJO_BLOB_CHANNEL_SERVICE_H_ |
| 7 |
| 8 #include "blimp/engine/mojo/blob_channel.mojom.h" |
| 9 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 10 |
| 11 namespace blimp { |
| 12 namespace engine { |
| 13 |
| 14 // Service for processing BlobChannel requests from the renderer. |
| 15 // Runs on the browser process. |
| 16 class BlobChannelService : public mojom::BlobChannel { |
| 17 public: |
| 18 // Creates a BlobChannel bound to the connection specified by |request|. |
| 19 explicit BlobChannelService(mojom::BlobChannelRequest request); |
| 20 ~BlobChannelService() override; |
| 21 |
| 22 // Factory method called by Mojo. |
| 23 static void Create(mojo::InterfaceRequest<mojom::BlobChannel> request); |
| 24 |
| 25 private: |
| 26 // BlobChannel implementation. |
| 27 void Put(const mojo::String& id, mojo::Array<uint8_t> data) override; |
| 28 void Push(const mojo::String& id) override; |
| 29 |
| 30 // Binds |this| and its object lifetime to a Mojo connection. |
| 31 mojo::StrongBinding<mojom::BlobChannel> binding_; |
| 32 |
| 33 DISALLOW_COPY_AND_ASSIGN(BlobChannelService); |
| 34 }; |
| 35 |
| 36 } // namespace engine |
| 37 } // namespace blimp |
| 38 |
| 39 #endif // BLIMP_ENGINE_MOJO_BLOB_CHANNEL_SERVICE_H_ |
| OLD | NEW |