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

Side by Side Diff: content/gpu/gpu_child_thread.cc

Issue 2803743002: Mojofy GpuHostMsg_FieldTrialActivated (Closed)
Patch Set: review 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/gpu/BUILD.gn ('k') | content/gpu/gpu_main.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/gpu/gpu_child_thread.h" 5 #include "content/gpu/gpu_child_thread.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/callback_helpers.h" 11 #include "base/callback_helpers.h"
12 #include "build/build_config.h" 12 #include "build/build_config.h"
13 #include "content/child/child_process.h" 13 #include "content/child/child_process.h"
14 #include "content/common/gpu_host_messages.h" 14 #include "content/common/field_trial_recorder.mojom.h"
15 #include "content/gpu/gpu_service_factory.h" 15 #include "content/gpu/gpu_service_factory.h"
16 #include "content/public/common/content_client.h" 16 #include "content/public/common/content_client.h"
17 #include "content/public/common/content_switches.h" 17 #include "content/public/common/content_switches.h"
18 #include "content/public/common/service_manager_connection.h" 18 #include "content/public/common/service_manager_connection.h"
19 #include "content/public/common/service_names.mojom.h"
19 #include "content/public/gpu/content_gpu_client.h" 20 #include "content/public/gpu/content_gpu_client.h"
20 #include "gpu/command_buffer/common/activity_flags.h" 21 #include "gpu/command_buffer/common/activity_flags.h"
21 #include "gpu/ipc/service/gpu_watchdog_thread.h" 22 #include "gpu/ipc/service/gpu_watchdog_thread.h"
22 #include "ipc/ipc_sync_message_filter.h" 23 #include "ipc/ipc_sync_message_filter.h"
23 #include "media/gpu/ipc/service/media_gpu_channel_manager.h" 24 #include "media/gpu/ipc/service/media_gpu_channel_manager.h"
25 #include "services/service_manager/public/cpp/connector.h"
24 #include "services/service_manager/public/cpp/interface_registry.h" 26 #include "services/service_manager/public/cpp/interface_registry.h"
25 #include "services/ui/gpu/interfaces/gpu_service.mojom.h" 27 #include "services/ui/gpu/interfaces/gpu_service.mojom.h"
26 28
27 #if defined(USE_OZONE) 29 #if defined(USE_OZONE)
28 #include "ui/ozone/public/ozone_platform.h" 30 #include "ui/ozone/public/ozone_platform.h"
29 #endif 31 #endif
30 32
31 #if defined(OS_ANDROID) 33 #if defined(OS_ANDROID)
32 #include "media/base/android/media_drm_bridge_client.h" 34 #include "media/base/android/media_drm_bridge_client.h"
33 #endif 35 #endif
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 125
124 if (GetContentClient()->gpu()) // NULL in tests. 126 if (GetContentClient()->gpu()) // NULL in tests.
125 GetContentClient()->gpu()->Initialize(this); 127 GetContentClient()->gpu()->Initialize(this);
126 AssociatedInterfaceRegistry* registry = &associated_interfaces_; 128 AssociatedInterfaceRegistry* registry = &associated_interfaces_;
127 registry->AddInterface(base::Bind( 129 registry->AddInterface(base::Bind(
128 &GpuChildThread::CreateGpuMainService, base::Unretained(this))); 130 &GpuChildThread::CreateGpuMainService, base::Unretained(this)));
129 } 131 }
130 132
131 void GpuChildThread::OnFieldTrialGroupFinalized(const std::string& trial_name, 133 void GpuChildThread::OnFieldTrialGroupFinalized(const std::string& trial_name,
132 const std::string& group_name) { 134 const std::string& group_name) {
133 Send(new GpuHostMsg_FieldTrialActivated(trial_name)); 135 mojom::FieldTrialRecorderPtr field_trial_recorder;
136 GetConnector()->BindInterface(mojom::kBrowserServiceName,
137 &field_trial_recorder);
138 field_trial_recorder->FieldTrialActivated(trial_name);
134 } 139 }
135 140
136 void GpuChildThread::CreateGpuMainService( 141 void GpuChildThread::CreateGpuMainService(
137 ui::mojom::GpuMainAssociatedRequest request) { 142 ui::mojom::GpuMainAssociatedRequest request) {
138 gpu_main_binding_.Bind(std::move(request)); 143 gpu_main_binding_.Bind(std::move(request));
139 } 144 }
140 145
141 bool GpuChildThread::Send(IPC::Message* msg) { 146 bool GpuChildThread::Send(IPC::Message* msg) {
142 // The GPU process must never send a synchronous IPC message to the browser 147 // The GPU process must never send a synchronous IPC message to the browser
143 // process. This could result in deadlock. 148 // process. This could result in deadlock.
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 213
209 void GpuChildThread::BindServiceFactoryRequest( 214 void GpuChildThread::BindServiceFactoryRequest(
210 service_manager::mojom::ServiceFactoryRequest request) { 215 service_manager::mojom::ServiceFactoryRequest request) {
211 DVLOG(1) << "GPU: Binding service_manager::mojom::ServiceFactoryRequest"; 216 DVLOG(1) << "GPU: Binding service_manager::mojom::ServiceFactoryRequest";
212 DCHECK(service_factory_); 217 DCHECK(service_factory_);
213 service_factory_bindings_.AddBinding(service_factory_.get(), 218 service_factory_bindings_.AddBinding(service_factory_.get(),
214 std::move(request)); 219 std::move(request));
215 } 220 }
216 221
217 } // namespace content 222 } // namespace content
OLDNEW
« no previous file with comments | « content/gpu/BUILD.gn ('k') | content/gpu/gpu_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698