Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Side by Side Diff: content/renderer/render_thread_impl.cc

Issue 2717213004: Move SharedBitmapManager implementation out of content/ (Closed)
Patch Set: fix compile Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/renderer/render_thread_impl.h ('k') | content/renderer/render_view_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 "content/child/appcache/appcache_dispatcher.h" 54 #include "content/child/appcache/appcache_dispatcher.h"
55 #include "content/child/appcache/appcache_frontend_impl.h" 55 #include "content/child/appcache/appcache_frontend_impl.h"
56 #include "content/child/blob_storage/blob_message_filter.h" 56 #include "content/child/blob_storage/blob_message_filter.h"
57 #include "content/child/child_histogram_message_filter.h" 57 #include "content/child/child_histogram_message_filter.h"
58 #include "content/child/child_resource_message_filter.h" 58 #include "content/child/child_resource_message_filter.h"
59 #include "content/child/child_shared_bitmap_manager.h"
60 #include "content/child/content_child_helpers.h" 59 #include "content/child/content_child_helpers.h"
61 #include "content/child/db_message_filter.h" 60 #include "content/child/db_message_filter.h"
62 #include "content/child/indexed_db/indexed_db_dispatcher.h" 61 #include "content/child/indexed_db/indexed_db_dispatcher.h"
63 #include "content/child/memory/child_memory_coordinator_impl.h" 62 #include "content/child/memory/child_memory_coordinator_impl.h"
64 #include "content/child/resource_dispatcher.h" 63 #include "content/child/resource_dispatcher.h"
65 #include "content/child/resource_scheduling_filter.h" 64 #include "content/child/resource_scheduling_filter.h"
66 #include "content/child/runtime_features.h" 65 #include "content/child/runtime_features.h"
67 #include "content/child/thread_safe_sender.h" 66 #include "content/child/thread_safe_sender.h"
68 #include "content/child/web_database_observer_impl.h" 67 #include "content/child/web_database_observer_impl.h"
69 #include "content/child/worker_thread_registry.h" 68 #include "content/child/worker_thread_registry.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 #include "media/renderers/gpu_video_accelerator_factories.h" 137 #include "media/renderers/gpu_video_accelerator_factories.h"
139 #include "mojo/public/cpp/bindings/strong_binding.h" 138 #include "mojo/public/cpp/bindings/strong_binding.h"
140 #include "net/base/net_errors.h" 139 #include "net/base/net_errors.h"
141 #include "net/base/port_util.h" 140 #include "net/base/port_util.h"
142 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" 141 #include "net/base/registry_controlled_domains/registry_controlled_domain.h"
143 #include "net/base/url_util.h" 142 #include "net/base/url_util.h"
144 #include "ppapi/features/features.h" 143 #include "ppapi/features/features.h"
145 #include "services/service_manager/public/cpp/connector.h" 144 #include "services/service_manager/public/cpp/connector.h"
146 #include "services/service_manager/public/cpp/interface_provider.h" 145 #include "services/service_manager/public/cpp/interface_provider.h"
147 #include "services/service_manager/public/cpp/interface_registry.h" 146 #include "services/service_manager/public/cpp/interface_registry.h"
147 #include "services/ui/public/cpp/bitmap/child_shared_bitmap_manager.h"
148 #include "services/ui/public/cpp/gpu/context_provider_command_buffer.h" 148 #include "services/ui/public/cpp/gpu/context_provider_command_buffer.h"
149 #include "services/ui/public/interfaces/constants.mojom.h" 149 #include "services/ui/public/interfaces/constants.mojom.h"
150 #include "skia/ext/event_tracer_impl.h" 150 #include "skia/ext/event_tracer_impl.h"
151 #include "skia/ext/skia_memory_dump_provider.h" 151 #include "skia/ext/skia_memory_dump_provider.h"
152 #include "third_party/WebKit/public/platform/WebCache.h" 152 #include "third_party/WebKit/public/platform/WebCache.h"
153 #include "third_party/WebKit/public/platform/WebImageGenerator.h" 153 #include "third_party/WebKit/public/platform/WebImageGenerator.h"
154 #include "third_party/WebKit/public/platform/WebMemoryCoordinator.h" 154 #include "third_party/WebKit/public/platform/WebMemoryCoordinator.h"
155 #include "third_party/WebKit/public/platform/WebNetworkStateNotifier.h" 155 #include "third_party/WebKit/public/platform/WebNetworkStateNotifier.h"
156 #include "third_party/WebKit/public/platform/WebString.h" 156 #include "third_party/WebKit/public/platform/WebString.h"
157 #include "third_party/WebKit/public/platform/WebThread.h" 157 #include "third_party/WebKit/public/platform/WebThread.h"
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 548
549 // static 549 // static
550 mojom::RenderMessageFilter* RenderThreadImpl::current_render_message_filter() { 550 mojom::RenderMessageFilter* RenderThreadImpl::current_render_message_filter() {
551 if (g_render_message_filter_for_testing) 551 if (g_render_message_filter_for_testing)
552 return g_render_message_filter_for_testing; 552 return g_render_message_filter_for_testing;
553 DCHECK(current()); 553 DCHECK(current());
554 return current()->render_message_filter(); 554 return current()->render_message_filter();
555 } 555 }
556 556
557 // static 557 // static
558 const scoped_refptr<mojom::ThreadSafeRenderMessageFilterAssociatedPtr>&
559 RenderThreadImpl::current_thread_safe_render_message_filter() {
560 DCHECK(current());
561 return current()->thread_safe_render_message_filter();
562 }
563
564 // static
565 void RenderThreadImpl::SetRenderMessageFilterForTesting( 558 void RenderThreadImpl::SetRenderMessageFilterForTesting(
566 mojom::RenderMessageFilter* render_message_filter) { 559 mojom::RenderMessageFilter* render_message_filter) {
567 g_render_message_filter_for_testing = render_message_filter; 560 g_render_message_filter_for_testing = render_message_filter;
568 } 561 }
569 562
570 // In single-process mode used for debugging, we don't pass a renderer client 563 // In single-process mode used for debugging, we don't pass a renderer client
571 // ID via command line because RenderThreadImpl lives in the same process as 564 // ID via command line because RenderThreadImpl lives in the same process as
572 // the browser 565 // the browser
573 RenderThreadImpl::RenderThreadImpl( 566 RenderThreadImpl::RenderThreadImpl(
574 const InProcessChildThreadParams& params, 567 const InProcessChildThreadParams& params,
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 lazy_tls.Pointer()->Set(this); 621 lazy_tls.Pointer()->Set(this);
629 622
630 // Register this object as the main thread. 623 // Register this object as the main thread.
631 ChildProcess::current()->set_main_thread(this); 624 ChildProcess::current()->set_main_thread(this);
632 625
633 gpu_ = ui::Gpu::Create( 626 gpu_ = ui::Gpu::Create(
634 GetConnector(), 627 GetConnector(),
635 IsRunningInMash() ? ui::mojom::kServiceName : mojom::kBrowserServiceName, 628 IsRunningInMash() ? ui::mojom::kServiceName : mojom::kBrowserServiceName,
636 GetIOTaskRunner()); 629 GetIOTaskRunner());
637 630
638 channel()->GetThreadSafeRemoteAssociatedInterface( 631 cc::mojom::SharedBitmapManagerAssociatedPtr shared_bitmap_manager_ptr;
639 &thread_safe_render_message_filter_); 632 render_message_filter()->GetSharedBitmapManager(
640 shared_bitmap_manager_.reset( 633 mojo::MakeRequest(&shared_bitmap_manager_ptr));
641 new ChildSharedBitmapManager(thread_safe_render_message_filter_)); 634 shared_bitmap_manager_.reset(new ui::ChildSharedBitmapManager(
635 cc::mojom::ThreadSafeSharedBitmapManagerAssociatedPtr::Create(
jbauman 2017/04/05 21:37:28 I'm not sure how this works, but I think we need t
xlai (Olivia) 2017/04/05 21:41:45 Why do we need IPC task runner? This line is con
636 std::move(shared_bitmap_manager_ptr))));
642 637
643 InitializeWebKit(resource_task_queue); 638 InitializeWebKit(resource_task_queue);
644 639
645 // In single process the single process is all there is. 640 // In single process the single process is all there is.
646 webkit_shared_timer_suspended_ = false; 641 webkit_shared_timer_suspended_ = false;
647 widget_count_ = 0; 642 widget_count_ = 0;
648 hidden_widget_count_ = 0; 643 hidden_widget_count_ = 0;
649 idle_notification_delay_in_ms_ = kInitialIdleHandlerDelayMs; 644 idle_notification_delay_in_ms_ = kInitialIdleHandlerDelayMs;
650 idle_notifications_to_skip_ = 0; 645 idle_notifications_to_skip_ = 0;
651 646
(...skipping 1410 matching lines...) Expand 10 before | Expand all | Expand 10 after
2062 GetChannel()->GetRemoteAssociatedInterface(&render_frame_message_filter_); 2057 GetChannel()->GetRemoteAssociatedInterface(&render_frame_message_filter_);
2063 return render_frame_message_filter_.get(); 2058 return render_frame_message_filter_.get();
2064 } 2059 }
2065 2060
2066 mojom::RenderMessageFilter* RenderThreadImpl::render_message_filter() { 2061 mojom::RenderMessageFilter* RenderThreadImpl::render_message_filter() {
2067 if (!render_message_filter_) 2062 if (!render_message_filter_)
2068 GetChannel()->GetRemoteAssociatedInterface(&render_message_filter_); 2063 GetChannel()->GetRemoteAssociatedInterface(&render_message_filter_);
2069 return render_message_filter_.get(); 2064 return render_message_filter_.get();
2070 } 2065 }
2071 2066
2072 const scoped_refptr<mojom::ThreadSafeRenderMessageFilterAssociatedPtr>&
2073 RenderThreadImpl::thread_safe_render_message_filter() {
2074 return thread_safe_render_message_filter_;
2075 }
2076
2077 gpu::GpuChannelHost* RenderThreadImpl::GetGpuChannel() { 2067 gpu::GpuChannelHost* RenderThreadImpl::GetGpuChannel() {
2078 if (!gpu_channel_) 2068 if (!gpu_channel_)
2079 return nullptr; 2069 return nullptr;
2080 if (gpu_channel_->IsLost()) 2070 if (gpu_channel_->IsLost())
2081 return nullptr; 2071 return nullptr;
2082 return gpu_channel_.get(); 2072 return gpu_channel_.get();
2083 } 2073 }
2084 2074
2085 void RenderThreadImpl::OnFieldTrialGroupFinalized( 2075 void RenderThreadImpl::OnFieldTrialGroupFinalized(
2086 const std::string& trial_name, 2076 const std::string& trial_name,
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
2468 } 2458 }
2469 } 2459 }
2470 2460
2471 void RenderThreadImpl::OnRendererInterfaceRequest( 2461 void RenderThreadImpl::OnRendererInterfaceRequest(
2472 mojom::RendererAssociatedRequest request) { 2462 mojom::RendererAssociatedRequest request) {
2473 DCHECK(!renderer_binding_.is_bound()); 2463 DCHECK(!renderer_binding_.is_bound());
2474 renderer_binding_.Bind(std::move(request)); 2464 renderer_binding_.Bind(std::move(request));
2475 } 2465 }
2476 2466
2477 } // namespace content 2467 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_thread_impl.h ('k') | content/renderer/render_view_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698