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

Unified Diff: content/browser/gpu/gpu_process_host.cc

Issue 1711533002: Decouple browser-specific GPU IPC messages from GPU service IPCs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed sievers@'s comments Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/gpu/gpu_process_host.cc
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index a696ecc44e6dc71e87b1a3b5f57cbd8ff3388c88..46585815dfba240cc9f00edcaa8589ae814f9d85 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -31,7 +31,7 @@
#include "content/browser/mojo/mojo_application_host.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/common/child_process_host_impl.h"
-#include "content/common/gpu/gpu_messages.h"
+#include "content/common/gpu/gpu_browser_messages.h"
#include "content/common/in_process_child_thread_params.h"
#include "content/common/view_messages.h"
#include "content/public/browser/browser_thread.h"
@@ -556,7 +556,7 @@ bool GpuProcessHost::Init() {
return false;
}
- if (!Send(new GpuMsg_Initialize()))
+ if (!Send(new GpuBrowserMsg_Initialize()))
return false;
return true;
@@ -600,27 +600,27 @@ void GpuProcessHost::AddFilter(IPC::MessageFilter* filter) {
bool GpuProcessHost::OnMessageReceived(const IPC::Message& message) {
DCHECK(CalledOnValidThread());
IPC_BEGIN_MESSAGE_MAP(GpuProcessHost, message)
- IPC_MESSAGE_HANDLER(GpuHostMsg_Initialized, OnInitialized)
- IPC_MESSAGE_HANDLER(GpuHostMsg_ChannelEstablished, OnChannelEstablished)
- IPC_MESSAGE_HANDLER(GpuHostMsg_GpuMemoryBufferCreated,
+ IPC_MESSAGE_HANDLER(GpuBrowserHostMsg_Initialized, OnInitialized)
+ IPC_MESSAGE_HANDLER(GpuBrowserHostMsg_ChannelEstablished,
+ OnChannelEstablished)
+ IPC_MESSAGE_HANDLER(GpuBrowserHostMsg_GpuMemoryBufferCreated,
OnGpuMemoryBufferCreated)
- IPC_MESSAGE_HANDLER(GpuHostMsg_DidCreateOffscreenContext,
+ IPC_MESSAGE_HANDLER(GpuBrowserHostMsg_DidCreateOffscreenContext,
OnDidCreateOffscreenContext)
- IPC_MESSAGE_HANDLER(GpuHostMsg_DidLoseContext, OnDidLoseContext)
- IPC_MESSAGE_HANDLER(GpuHostMsg_DidDestroyOffscreenContext,
+ IPC_MESSAGE_HANDLER(GpuBrowserHostMsg_DidLoseContext, OnDidLoseContext)
+ IPC_MESSAGE_HANDLER(GpuBrowserHostMsg_DidDestroyOffscreenContext,
OnDidDestroyOffscreenContext)
- IPC_MESSAGE_HANDLER(GpuHostMsg_GpuMemoryUmaStats,
+ IPC_MESSAGE_HANDLER(GpuBrowserHostMsg_GpuMemoryUmaStats,
OnGpuMemoryUmaStatsReceived)
#if defined(OS_MACOSX)
- IPC_MESSAGE_HANDLER_GENERIC(GpuHostMsg_AcceleratedSurfaceBuffersSwapped,
- OnAcceleratedSurfaceBuffersSwapped(message))
+ IPC_MESSAGE_HANDLER_GENERIC(
+ GpuBrowserHostMsg_AcceleratedSurfaceBuffersSwapped,
+ OnAcceleratedSurfaceBuffersSwapped(message))
#endif
- IPC_MESSAGE_HANDLER(GpuHostMsg_DestroyChannel,
- OnDestroyChannel)
- IPC_MESSAGE_HANDLER(GpuHostMsg_CacheShader,
- OnCacheShader)
+ IPC_MESSAGE_HANDLER(GpuBrowserHostMsg_DestroyChannel, OnDestroyChannel)
+ IPC_MESSAGE_HANDLER(GpuBrowserHostMsg_CacheShader, OnCacheShader)
#if defined(OS_WIN)
- IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceCreatedChildWindow,
+ IPC_MESSAGE_HANDLER(GpuBrowserHostMsg_AcceleratedSurfaceCreatedChildWindow,
OnAcceleratedSurfaceCreatedChildWindow)
#endif
@@ -642,7 +642,7 @@ void GpuProcessHost::OnAcceleratedSurfaceCreatedChildWindow(
if (!thread_id || process_id != ::GetCurrentProcessId()) {
process_->TerminateOnBadMessageReceived(
- GpuHostMsg_AcceleratedSurfaceCreatedChildWindow::ID);
+ GpuBrowserHostMsg_AcceleratedSurfaceCreatedChildWindow::ID);
return;
}
}
@@ -653,7 +653,7 @@ void GpuProcessHost::OnAcceleratedSurfaceCreatedChildWindow(
if (!thread_id || process_id != process_->GetProcess().Pid()) {
process_->TerminateOnBadMessageReceived(
- GpuHostMsg_AcceleratedSurfaceCreatedChildWindow::ID);
+ GpuBrowserHostMsg_AcceleratedSurfaceCreatedChildWindow::ID);
return;
}
}
@@ -689,16 +689,16 @@ void GpuProcessHost::EstablishGpuChannel(
return;
}
- GpuMsg_EstablishChannel_Params params;
+ EstablishChannelParams params;
params.client_id = client_id;
params.client_tracing_id = client_tracing_id;
params.preempts = preempts;
params.allow_view_command_buffers = allow_view_command_buffers;
params.allow_real_time_streams = allow_real_time_streams;
- if (Send(new GpuMsg_EstablishChannel(params))) {
+ if (Send(new GpuBrowserMsg_EstablishChannel(params))) {
channel_requests_.push(callback);
} else {
- DVLOG(1) << "Failed to send GpuMsg_EstablishChannel.";
+ DVLOG(1) << "Failed to send GpuBrowserMsg_EstablishChannel.";
callback.Run(IPC::ChannelHandle(), gpu::GPUInfo());
}
@@ -720,7 +720,7 @@ void GpuProcessHost::CreateGpuMemoryBuffer(
DCHECK(CalledOnValidThread());
- GpuMsg_CreateGpuMemoryBuffer_Params params;
+ GpuBrowserMsg_CreateGpuMemoryBuffer_Params params;
params.id = id;
params.size = size;
params.format = format;
@@ -728,7 +728,7 @@ void GpuProcessHost::CreateGpuMemoryBuffer(
params.client_id = client_id;
params.surface_handle =
GpuSurfaceTracker::GetInstance()->GetSurfaceHandle(surface_id).handle;
- if (Send(new GpuMsg_CreateGpuMemoryBuffer(params))) {
+ if (Send(new GpuBrowserMsg_CreateGpuMemoryBuffer(params))) {
create_gpu_memory_buffer_requests_.push(callback);
} else {
callback.Run(gfx::GpuMemoryBufferHandle());
@@ -746,13 +746,13 @@ void GpuProcessHost::CreateGpuMemoryBufferFromHandle(
DCHECK(CalledOnValidThread());
- GpuMsg_CreateGpuMemoryBufferFromHandle_Params params;
+ GpuBrowserMsg_CreateGpuMemoryBufferFromHandle_Params params;
params.handle = handle;
params.id = id;
params.size = size;
params.format = format;
params.client_id = client_id;
- if (Send(new GpuMsg_CreateGpuMemoryBufferFromHandle(params))) {
+ if (Send(new GpuBrowserMsg_CreateGpuMemoryBufferFromHandle(params))) {
create_gpu_memory_buffer_requests_.push(callback);
} else {
callback.Run(gfx::GpuMemoryBufferHandle());
@@ -766,7 +766,7 @@ void GpuProcessHost::DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
DCHECK(CalledOnValidThread());
- Send(new GpuMsg_DestroyGpuMemoryBuffer(id, client_id, sync_token));
+ Send(new GpuBrowserMsg_DestroyGpuMemoryBuffer(id, client_id, sync_token));
}
void GpuProcessHost::OnInitialized(bool result, const gpu::GPUInfo& gpu_info) {
@@ -786,9 +786,8 @@ void GpuProcessHost::OnChannelEstablished(
if (channel_requests_.empty()) {
// This happens when GPU process is compromised.
- RouteOnUIThread(GpuHostMsg_OnLogMessage(
- logging::LOG_WARNING,
- "WARNING",
+ RouteOnUIThread(GpuBrowserHostMsg_OnLogMessage(
+ logging::LOG_WARNING, "WARNING",
"Received a ChannelEstablished message but no requests in queue."));
return;
}
@@ -799,11 +798,10 @@ void GpuProcessHost::OnChannelEstablished(
// GPU channel.
if (!channel_handle.name.empty() &&
!GpuDataManagerImpl::GetInstance()->GpuAccessAllowed(NULL)) {
- Send(new GpuMsg_CloseChannel(channel_handle));
+ Send(new GpuBrowserMsg_CloseChannel(channel_handle));
callback.Run(IPC::ChannelHandle(), gpu::GPUInfo());
- RouteOnUIThread(GpuHostMsg_OnLogMessage(
- logging::LOG_WARNING,
- "WARNING",
+ RouteOnUIThread(GpuBrowserHostMsg_OnLogMessage(
+ logging::LOG_WARNING, "WARNING",
"Hardware acceleration is unavailable."));
return;
}
@@ -925,7 +923,7 @@ void GpuProcessHost::ForceShutdown() {
}
void GpuProcessHost::StopGpuProcess() {
- Send(new GpuMsg_Finalize());
+ Send(new GpuBrowserMsg_Finalize());
}
bool GpuProcessHost::LaunchGpuProcess(const std::string& channel_id) {
@@ -1120,7 +1118,7 @@ void GpuProcessHost::LoadedShader(const std::string& key,
const std::string& data) {
std::string prefix = GetShaderPrefixKey();
if (!key.compare(0, prefix.length(), prefix))
- Send(new GpuMsg_LoadedShader(data));
+ Send(new GpuBrowserMsg_LoadedShader(data));
}
void GpuProcessHost::CreateChannelCache(int32_t client_id) {

Powered by Google App Engine
This is Rietveld 408576698