Chromium Code Reviews| 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/app/blimp_content_renderer_client.h" | 5 #include "blimp/engine/app/blimp_content_renderer_client.h" |
| 6 | 6 |
| 7 #include "blimp/common/compositor/blimp_image_serialization_processor.h" | 7 #include "blimp/common/compositor/blimp_image_serialization_processor.h" |
| 8 #include "blimp/engine/mojo/blob_channel.mojom.h" | |
| 9 #include "blimp/engine/renderer/engine_image_serialization_processor.h" | |
| 8 #include "components/web_cache/renderer/web_cache_render_process_observer.h" | 10 #include "components/web_cache/renderer/web_cache_render_process_observer.h" |
| 11 #include "content/public/common/service_registry.h" | |
| 12 #include "content/public/renderer/render_thread.h" | |
| 9 | 13 |
| 10 namespace blimp { | 14 namespace blimp { |
| 11 namespace engine { | 15 namespace engine { |
| 16 namespace { | |
| 12 | 17 |
| 13 BlimpContentRendererClient::BlimpContentRendererClient( | 18 BlobChannelMojoPtr GetConnectedBlobChannel() { |
|
nyquist
2016/04/05 22:13:19
Is this call blocking across the renderer and brow
Kevin M
2016/04/06 00:01:44
The renderer: yes (at startup), the browser: no. T
| |
| 14 scoped_ptr<BlimpImageSerializationProcessor> image_serialization_processor) | 19 BlobChannelMojoPtr blob_channel_ptr; |
| 15 : image_serialization_processor_(std::move(image_serialization_processor)) { | 20 content::RenderThread::Get()->GetServiceRegistry()->ConnectToRemoteService( |
| 21 mojo::GetProxy(&blob_channel_ptr)); | |
| 22 DCHECK(blob_channel_ptr); | |
| 23 return blob_channel_ptr; | |
| 16 } | 24 } |
| 17 | 25 |
| 26 } // namespace | |
| 27 | |
| 28 BlimpContentRendererClient::BlimpContentRendererClient() {} | |
| 29 | |
| 18 BlimpContentRendererClient::~BlimpContentRendererClient() {} | 30 BlimpContentRendererClient::~BlimpContentRendererClient() {} |
| 19 | 31 |
| 20 void BlimpContentRendererClient::RenderThreadStarted() { | 32 void BlimpContentRendererClient::RenderThreadStarted() { |
| 21 web_cache_observer_.reset(new web_cache::WebCacheRenderProcessObserver()); | 33 web_cache_observer_.reset(new web_cache::WebCacheRenderProcessObserver()); |
| 34 image_serialization_processor_.reset( | |
| 35 new EngineImageSerializationProcessor(GetConnectedBlobChannel())); | |
| 22 } | 36 } |
| 23 | 37 |
| 24 cc::ImageSerializationProcessor* | 38 cc::ImageSerializationProcessor* |
| 25 BlimpContentRendererClient::GetImageSerializationProcessor() { | 39 BlimpContentRendererClient::GetImageSerializationProcessor() { |
| 26 return image_serialization_processor_.get(); | 40 return image_serialization_processor_.get(); |
| 27 } | 41 } |
| 28 | 42 |
| 29 } // namespace engine | 43 } // namespace engine |
| 30 } // namespace blimp | 44 } // namespace blimp |
| OLD | NEW |