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

Unified Diff: content/common/gpu/gpu_channel_manager.h

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/common/gpu/gpu_channel_manager.h
diff --git a/content/common/gpu/gpu_channel_manager.h b/content/common/gpu/gpu_channel_manager.h
index 0fcf7ca150e9759d48fc940feddc2b69f42ec8f6..f31090fa24c4181edbb5acd9f600c3cf0b0bf495 100644
--- a/content/common/gpu/gpu_channel_manager.h
+++ b/content/common/gpu/gpu_channel_manager.h
@@ -21,11 +21,13 @@
#include "content/common/content_param_traits.h"
#include "content/common/gpu/gpu_memory_manager.h"
#include "content/common/message_router.h"
+#include "gpu/command_buffer/common/constants.h"
#include "ipc/ipc_listener.h"
#include "ipc/ipc_sender.h"
#include "ui/gfx/gpu_memory_buffer.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/gl/gl_surface.h"
+#include "url/gurl.h"
namespace base {
class WaitableEvent;
@@ -54,21 +56,20 @@ struct ChannelHandle;
class SyncChannel;
}
-struct GPUCreateCommandBufferConfig;
-struct GpuMsg_EstablishChannel_Params;
-
namespace content {
class GpuChannel;
+class GpuChannelManagerDelegate;
class GpuMemoryBufferFactory;
class GpuWatchdog;
+struct EstablishChannelParams;
// A GpuChannelManager is a thread responsible for issuing rendering commands
// managing the lifetimes of GPU channels and forwarding IPC requests from the
// browser process to them based on the corresponding renderer ID.
-class CONTENT_EXPORT GpuChannelManager : public IPC::Listener,
- public IPC::Sender {
+class CONTENT_EXPORT GpuChannelManager : public IPC::Listener {
public:
- GpuChannelManager(IPC::SyncChannel* channel,
+ GpuChannelManager(GpuChannelManagerDelegate* delegate,
+ IPC::SyncChannel* channel,
GpuWatchdog* watchdog,
base::SingleThreadTaskRunner* task_runner,
base::SingleThreadTaskRunner* io_task_runner,
@@ -77,15 +78,29 @@ class CONTENT_EXPORT GpuChannelManager : public IPC::Listener,
GpuMemoryBufferFactory* gpu_memory_buffer_factory);
~GpuChannelManager() override;
+ GpuChannelManagerDelegate* delegate() { return delegate_; }
+ const GpuChannelManagerDelegate* delegate() const { return delegate_; }
+
+ void EstablishChannel(const EstablishChannelParams& params);
+ void CloseChannel(const IPC::ChannelHandle& channel_handle);
+ void PopulateShaderCache(const std::string& shader);
+ void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
+ int client_id,
+ const gpu::SyncToken& sync_token);
+ void UpdateValueState(int client_id,
+ unsigned int target,
+ const gpu::ValueState& state);
+#if defined(OS_ANDROID)
+ void WakeUpGpu();
+#endif
+ void DestroyAllChannels();
+
// Remove the channel for a particular renderer.
void RemoveChannel(int client_id);
// Listener overrides.
bool OnMessageReceived(const IPC::Message& msg) override;
- // Sender overrides.
- bool Send(IPC::Message* msg) override;
-
void LoseAllContexts();
int GenerateRouteID();
@@ -147,30 +162,15 @@ class CONTENT_EXPORT GpuChannelManager : public IPC::Listener,
base::ScopedPtrHashMap<int32_t, scoped_ptr<GpuChannel>> gpu_channels_;
private:
- // Message handlers.
- bool OnControlMessageReceived(const IPC::Message& msg);
- void OnEstablishChannel(const GpuMsg_EstablishChannel_Params& params);
- void OnCloseChannel(const IPC::ChannelHandle& channel_handle);
- void OnVisibilityChanged(int32_t render_view_id,
- int32_t client_id,
- bool visible);
- void OnLoadedShader(const std::string& shader);
- void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, int client_id);
- void DestroyGpuMemoryBufferOnIO(gfx::GpuMemoryBufferId id, int client_id);
- void OnDestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
- int client_id,
- const gpu::SyncToken& sync_token);
-
- void OnUpdateValueState(int client_id,
- unsigned int target,
- const gpu::ValueState& state);
+ void InternalDestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, int client_id);
+ void InternalDestroyGpuMemoryBufferOnIO(gfx::GpuMemoryBufferId id,
+ int client_id);
#if defined(OS_ANDROID)
- void OnWakeUpGpu();
void ScheduleWakeUpGpu();
void DoWakeUpGpu();
#endif
- void OnLoseAllContexts();
+ GpuChannelManagerDelegate* const delegate_;
// Used to send and receive IPC messages from the browser process.
IPC::SyncChannel* const channel_;
MessageRouter router_;

Powered by Google App Engine
This is Rietveld 408576698