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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 #include "cc/base/switches.h" | 44 #include "cc/base/switches.h" |
45 #include "cc/blink/web_layer_impl.h" | 45 #include "cc/blink/web_layer_impl.h" |
46 #include "cc/output/buffer_to_texture_target_map.h" | 46 #include "cc/output/buffer_to_texture_target_map.h" |
47 #include "cc/output/compositor_frame_sink.h" | 47 #include "cc/output/compositor_frame_sink.h" |
48 #include "cc/output/copy_output_request.h" | 48 #include "cc/output/copy_output_request.h" |
49 #include "cc/output/vulkan_in_process_context_provider.h" | 49 #include "cc/output/vulkan_in_process_context_provider.h" |
50 #include "cc/raster/task_graph_runner.h" | 50 #include "cc/raster/task_graph_runner.h" |
51 #include "cc/trees/layer_tree_host_common.h" | 51 #include "cc/trees/layer_tree_host_common.h" |
52 #include "cc/trees/layer_tree_settings.h" | 52 #include "cc/trees/layer_tree_settings.h" |
53 #include "components/discardable_memory/client/client_discardable_shared_memory_
manager.h" | 53 #include "components/discardable_memory/client/client_discardable_shared_memory_
manager.h" |
| 54 #include "components/metrics/public/interfaces/single_value_histograms.mojom.h" |
| 55 #include "components/metrics/single_value_histograms_factory_impl.h" |
54 #include "content/child/appcache/appcache_dispatcher.h" | 56 #include "content/child/appcache/appcache_dispatcher.h" |
55 #include "content/child/appcache/appcache_frontend_impl.h" | 57 #include "content/child/appcache/appcache_frontend_impl.h" |
56 #include "content/child/blob_storage/blob_message_filter.h" | 58 #include "content/child/blob_storage/blob_message_filter.h" |
57 #include "content/child/child_histogram_message_filter.h" | 59 #include "content/child/child_histogram_message_filter.h" |
58 #include "content/child/child_resource_message_filter.h" | 60 #include "content/child/child_resource_message_filter.h" |
59 #include "content/child/content_child_helpers.h" | 61 #include "content/child/content_child_helpers.h" |
60 #include "content/child/db_message_filter.h" | 62 #include "content/child/db_message_filter.h" |
61 #include "content/child/indexed_db/indexed_db_dispatcher.h" | 63 #include "content/child/indexed_db/indexed_db_dispatcher.h" |
62 #include "content/child/memory/child_memory_coordinator_impl.h" | 64 #include "content/child/memory/child_memory_coordinator_impl.h" |
63 #include "content/child/resource_dispatcher.h" | 65 #include "content/child/resource_dispatcher.h" |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU) | 603 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU) |
602 // On Mac and Android Java UI, the select popups are rendered by the browser. | 604 // On Mac and Android Java UI, the select popups are rendered by the browser. |
603 blink::WebView::SetUseExternalPopupMenus(true); | 605 blink::WebView::SetUseExternalPopupMenus(true); |
604 #endif | 606 #endif |
605 | 607 |
606 lazy_tls.Pointer()->Set(this); | 608 lazy_tls.Pointer()->Set(this); |
607 | 609 |
608 // Register this object as the main thread. | 610 // Register this object as the main thread. |
609 ChildProcess::current()->set_main_thread(this); | 611 ChildProcess::current()->set_main_thread(this); |
610 | 612 |
| 613 // In single process mode we may already have a factory set. |
| 614 if (!base::SingleValueHistogramsFactory::Get()) { |
| 615 metrics::mojom::SingleValueHistogramsProviderPtr metric_provider; |
| 616 GetConnector()->BindInterface(mojom::kBrowserServiceName, |
| 617 mojo::MakeRequest(&metric_provider)); |
| 618 base::SingleValueHistogramsFactory::SetFactory( |
| 619 new metrics::SingleValueHistogramsFactoryImpl( |
| 620 base::ThreadTaskRunnerHandle::Get(), std::move(metric_provider))); |
| 621 } |
| 622 |
611 gpu_ = ui::Gpu::Create( | 623 gpu_ = ui::Gpu::Create( |
612 GetConnector(), | 624 GetConnector(), |
613 IsRunningInMash() ? ui::mojom::kServiceName : mojom::kBrowserServiceName, | 625 IsRunningInMash() ? ui::mojom::kServiceName : mojom::kBrowserServiceName, |
614 GetIOTaskRunner()); | 626 GetIOTaskRunner()); |
615 | 627 |
616 cc::mojom::SharedBitmapManagerAssociatedPtr shared_bitmap_manager_ptr; | 628 cc::mojom::SharedBitmapManagerAssociatedPtr shared_bitmap_manager_ptr; |
617 render_message_filter()->GetSharedBitmapManager( | 629 render_message_filter()->GetSharedBitmapManager( |
618 mojo::MakeRequest(&shared_bitmap_manager_ptr)); | 630 mojo::MakeRequest(&shared_bitmap_manager_ptr)); |
619 shared_bitmap_manager_.reset(new ui::ChildSharedBitmapManager( | 631 shared_bitmap_manager_.reset(new ui::ChildSharedBitmapManager( |
620 cc::mojom::ThreadSafeSharedBitmapManagerAssociatedPtr::Create( | 632 cc::mojom::ThreadSafeSharedBitmapManagerAssociatedPtr::Create( |
(...skipping 1827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2448 } | 2460 } |
2449 } | 2461 } |
2450 | 2462 |
2451 void RenderThreadImpl::OnRendererInterfaceRequest( | 2463 void RenderThreadImpl::OnRendererInterfaceRequest( |
2452 mojom::RendererAssociatedRequest request) { | 2464 mojom::RendererAssociatedRequest request) { |
2453 DCHECK(!renderer_binding_.is_bound()); | 2465 DCHECK(!renderer_binding_.is_bound()); |
2454 renderer_binding_.Bind(std::move(request)); | 2466 renderer_binding_.Bind(std::move(request)); |
2455 } | 2467 } |
2456 | 2468 |
2457 } // namespace content | 2469 } // namespace content |
OLD | NEW |