OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/renderer/render_thread_impl.h" | 5 #include "content/renderer/render_thread_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <map> | 9 #include <map> |
10 #include <utility> | 10 #include <utility> |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
530 | 530 |
531 // static | 531 // static |
532 mojom::RenderMessageFilter* RenderThreadImpl::current_render_message_filter() { | 532 mojom::RenderMessageFilter* RenderThreadImpl::current_render_message_filter() { |
533 if (g_render_message_filter_for_testing) | 533 if (g_render_message_filter_for_testing) |
534 return g_render_message_filter_for_testing; | 534 return g_render_message_filter_for_testing; |
535 DCHECK(current()); | 535 DCHECK(current()); |
536 return current()->render_message_filter(); | 536 return current()->render_message_filter(); |
537 } | 537 } |
538 | 538 |
539 // static | 539 // static |
540 mojom::RenderMessageFilterUI* | |
541 RenderThreadImpl::current_render_message_filter_ui() { | |
542 DCHECK(current()); | |
543 return current()->render_message_filter_ui(); | |
544 } | |
545 | |
546 // static | |
540 void RenderThreadImpl::SetRenderMessageFilterForTesting( | 547 void RenderThreadImpl::SetRenderMessageFilterForTesting( |
541 mojom::RenderMessageFilter* render_message_filter) { | 548 mojom::RenderMessageFilter* render_message_filter) { |
542 g_render_message_filter_for_testing = render_message_filter; | 549 g_render_message_filter_for_testing = render_message_filter; |
543 } | 550 } |
544 | 551 |
545 // In single-process mode used for debugging, we don't pass a renderer client | 552 // In single-process mode used for debugging, we don't pass a renderer client |
546 // ID via command line because RenderThreadImpl lives in the same process as | 553 // ID via command line because RenderThreadImpl lives in the same process as |
547 // the browser | 554 // the browser |
548 RenderThreadImpl::RenderThreadImpl( | 555 RenderThreadImpl::RenderThreadImpl( |
549 const InProcessChildThreadParams& params, | 556 const InProcessChildThreadParams& params, |
(...skipping 1498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2048 GetChannel()->GetRemoteAssociatedInterface(&render_frame_message_filter_); | 2055 GetChannel()->GetRemoteAssociatedInterface(&render_frame_message_filter_); |
2049 return render_frame_message_filter_.get(); | 2056 return render_frame_message_filter_.get(); |
2050 } | 2057 } |
2051 | 2058 |
2052 mojom::RenderMessageFilter* RenderThreadImpl::render_message_filter() { | 2059 mojom::RenderMessageFilter* RenderThreadImpl::render_message_filter() { |
2053 if (!render_message_filter_) | 2060 if (!render_message_filter_) |
2054 GetChannel()->GetRemoteAssociatedInterface(&render_message_filter_); | 2061 GetChannel()->GetRemoteAssociatedInterface(&render_message_filter_); |
2055 return render_message_filter_.get(); | 2062 return render_message_filter_.get(); |
2056 } | 2063 } |
2057 | 2064 |
2065 mojom::RenderMessageFilterUI* RenderThreadImpl::render_message_filter_ui() { | |
2066 if (!render_message_filter_ui_) { | |
2067 blink_platform_impl_->GetInterfaceProvider()->GetInterface( | |
Charlie Harrison
2017/04/13 19:27:58
This is weird and wrong. Probably should just use
dcheng
2017/04/13 21:00:14
Maybe this should be an associated interface to ke
Charlie Harrison
2017/04/13 21:48:12
Hm... How would that work? Isn't it fundamentally
| |
2068 mojo::MakeRequest(&render_message_filter_ui_)); | |
2069 } | |
2070 | |
2071 return render_message_filter_ui_.get(); | |
2072 } | |
2073 | |
2058 gpu::GpuChannelHost* RenderThreadImpl::GetGpuChannel() { | 2074 gpu::GpuChannelHost* RenderThreadImpl::GetGpuChannel() { |
2059 if (!gpu_channel_) | 2075 if (!gpu_channel_) |
2060 return nullptr; | 2076 return nullptr; |
2061 if (gpu_channel_->IsLost()) | 2077 if (gpu_channel_->IsLost()) |
2062 return nullptr; | 2078 return nullptr; |
2063 return gpu_channel_.get(); | 2079 return gpu_channel_.get(); |
2064 } | 2080 } |
2065 | 2081 |
2066 void RenderThreadImpl::OnFieldTrialGroupFinalized( | 2082 void RenderThreadImpl::OnFieldTrialGroupFinalized( |
2067 const std::string& trial_name, | 2083 const std::string& trial_name, |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2449 } | 2465 } |
2450 } | 2466 } |
2451 | 2467 |
2452 void RenderThreadImpl::OnRendererInterfaceRequest( | 2468 void RenderThreadImpl::OnRendererInterfaceRequest( |
2453 mojom::RendererAssociatedRequest request) { | 2469 mojom::RendererAssociatedRequest request) { |
2454 DCHECK(!renderer_binding_.is_bound()); | 2470 DCHECK(!renderer_binding_.is_bound()); |
2455 renderer_binding_.Bind(std::move(request)); | 2471 renderer_binding_.Bind(std::move(request)); |
2456 } | 2472 } |
2457 | 2473 |
2458 } // namespace content | 2474 } // namespace content |
OLD | NEW |