| 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 #include "blimp/engine/renderer/blimp_content_renderer_client.h" | 5 #include "blimp/engine/renderer/blimp_content_renderer_client.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" |
| 7 #include "blimp/engine/mojo/blob_channel.mojom.h" | 8 #include "blimp/engine/mojo/blob_channel.mojom.h" |
| 9 #include "blimp/engine/renderer/blob_channel_sender_proxy.h" |
| 8 #include "blimp/engine/renderer/engine_image_serialization_processor.h" | 10 #include "blimp/engine/renderer/engine_image_serialization_processor.h" |
| 9 #include "components/web_cache/renderer/web_cache_impl.h" | 11 #include "components/web_cache/renderer/web_cache_impl.h" |
| 10 #include "content/public/common/service_registry.h" | |
| 11 #include "content/public/renderer/render_thread.h" | |
| 12 | 12 |
| 13 namespace blimp { | 13 namespace blimp { |
| 14 namespace engine { | 14 namespace engine { |
| 15 namespace { | |
| 16 | |
| 17 mojom::BlobChannelPtr GetConnectedBlobChannel() { | |
| 18 mojom::BlobChannelPtr blob_channel_ptr; | |
| 19 content::RenderThread::Get()->GetServiceRegistry()->ConnectToRemoteService( | |
| 20 mojo::GetProxy(&blob_channel_ptr)); | |
| 21 DCHECK(blob_channel_ptr); | |
| 22 return blob_channel_ptr; | |
| 23 } | |
| 24 | |
| 25 } // namespace | |
| 26 | 15 |
| 27 BlimpContentRendererClient::BlimpContentRendererClient() {} | 16 BlimpContentRendererClient::BlimpContentRendererClient() {} |
| 28 | 17 |
| 29 BlimpContentRendererClient::~BlimpContentRendererClient() {} | 18 BlimpContentRendererClient::~BlimpContentRendererClient() {} |
| 30 | 19 |
| 31 void BlimpContentRendererClient::RenderThreadStarted() { | 20 void BlimpContentRendererClient::RenderThreadStarted() { |
| 32 web_cache_impl_.reset(new web_cache::WebCacheImpl()); | 21 web_cache_impl_.reset(new web_cache::WebCacheImpl()); |
| 33 image_serialization_processor_.reset( | 22 image_serialization_processor_.reset(new EngineImageSerializationProcessor( |
| 34 new EngineImageSerializationProcessor(GetConnectedBlobChannel())); | 23 base::WrapUnique(new BlobChannelSenderProxy))); |
| 35 } | 24 } |
| 36 | 25 |
| 37 cc::ImageSerializationProcessor* | 26 cc::ImageSerializationProcessor* |
| 38 BlimpContentRendererClient::GetImageSerializationProcessor() { | 27 BlimpContentRendererClient::GetImageSerializationProcessor() { |
| 39 return image_serialization_processor_.get(); | 28 return image_serialization_processor_.get(); |
| 40 } | 29 } |
| 41 | 30 |
| 42 } // namespace engine | 31 } // namespace engine |
| 43 } // namespace blimp | 32 } // namespace blimp |
| OLD | NEW |