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

Side by Side Diff: content/browser/gpu/gpu_process_host_ui_shim.cc

Issue 2763493002: gpu: Use mojom API for recording log messages to the host. (Closed)
Patch Set: add comment Created 3 years, 9 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
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/browser/gpu/gpu_process_host_ui_shim.h" 5 #include "content/browser/gpu/gpu_process_host_ui_shim.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 #if defined(USE_OZONE) 128 #if defined(USE_OZONE)
129 if (ui::OzonePlatform::GetInstance() 129 if (ui::OzonePlatform::GetInstance()
130 ->GetGpuPlatformSupportHost() 130 ->GetGpuPlatformSupportHost()
131 ->OnMessageReceived(message)) 131 ->OnMessageReceived(message))
132 return true; 132 return true;
133 #endif 133 #endif
134 134
135 if (message.routing_id() != MSG_ROUTING_CONTROL) 135 if (message.routing_id() != MSG_ROUTING_CONTROL)
136 return false; 136 return false;
137 137
138 return OnControlMessageReceived(message); 138 NOTREACHED() << "Invalid message with type = " << message.type();
139 return true;
139 } 140 }
140 141
141 GpuProcessHostUIShim::~GpuProcessHostUIShim() { 142 GpuProcessHostUIShim::~GpuProcessHostUIShim() {
142 DCHECK(CalledOnValidThread()); 143 DCHECK(CalledOnValidThread());
143 g_hosts_by_id.Pointer()->Remove(host_id_); 144 g_hosts_by_id.Pointer()->Remove(host_id_);
144 } 145 }
145 146
146 bool GpuProcessHostUIShim::OnControlMessageReceived(
147 const IPC::Message& message) {
148 DCHECK(CalledOnValidThread());
149
150 IPC_BEGIN_MESSAGE_MAP(GpuProcessHostUIShim, message)
151 IPC_MESSAGE_HANDLER(GpuHostMsg_OnLogMessage, OnLogMessage)
152 IPC_MESSAGE_UNHANDLED_ERROR()
153 IPC_END_MESSAGE_MAP()
154
155 return true;
156 }
157
158 void GpuProcessHostUIShim::OnLogMessage(
159 int level,
160 const std::string& header,
161 const std::string& message) {
162 GpuDataManagerImpl::GetInstance()->AddLogMessage(
163 level, header, message);
164 }
165
166 #if defined(OS_ANDROID) 147 #if defined(OS_ANDROID)
167 // static 148 // static
168 void GpuProcessHostUIShim::RegisterUIThreadMojoInterfaces( 149 void GpuProcessHostUIShim::RegisterUIThreadMojoInterfaces(
169 service_manager::InterfaceRegistry* registry) { 150 service_manager::InterfaceRegistry* registry) {
170 registry->AddInterface(base::Bind( 151 registry->AddInterface(base::Bind(
171 &BindJavaInterfaceOnUIThread<media::mojom::AndroidOverlayProvider>)); 152 &BindJavaInterfaceOnUIThread<media::mojom::AndroidOverlayProvider>));
172 } 153 }
173 #endif 154 #endif
174 155
175 } // namespace content 156 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698