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

Unified Diff: content/renderer/gpu/gpu_channel_host.h

Issue 9270025: Remove renderer dependencies from the GPU client classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add overrides Created 8 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
« no previous file with comments | « content/renderer/gpu/command_buffer_proxy.cc ('k') | content/renderer/gpu/gpu_channel_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/gpu/gpu_channel_host.h
diff --git a/content/renderer/gpu/gpu_channel_host.h b/content/renderer/gpu/gpu_channel_host.h
index 554fe19a144cdab0768e0f257b34928206ee2b77..f06f1c9006b0735134b97b941a336520c84043eb 100644
--- a/content/renderer/gpu/gpu_channel_host.h
+++ b/content/renderer/gpu/gpu_channel_host.h
@@ -15,6 +15,7 @@
#include "base/memory/weak_ptr.h"
#include "base/process_util.h"
#include "base/synchronization/lock.h"
+#include "content/common/gpu/gpu_process_launch_causes.h"
#include "content/common/message_router.h"
#include "content/public/common/gpu_info.h"
#include "content/renderer/gpu/gpu_video_decode_accelerator_host.h"
@@ -26,8 +27,10 @@
#include "ui/gfx/size.h"
class CommandBufferProxy;
+struct GPUCreateCommandBufferConfig;
class GURL;
class TransportTextureService;
+class MessageLoop;
namespace base {
class MessageLoopProxy;
@@ -45,6 +48,31 @@ struct GpuListenerInfo {
scoped_refptr<base::MessageLoopProxy> loop;
};
+class GpuChannelHostFactory {
+ public:
+ virtual ~GpuChannelHostFactory();
+ static GpuChannelHostFactory* instance() { return instance_; }
+
+ virtual bool IsMainThread() = 0;
+ virtual bool IsIOThread() = 0;
+ virtual MessageLoop* GetMainLoop() = 0;
+ virtual base::MessageLoopProxy* GetIOLoopProxy() = 0;
+ virtual base::WaitableEvent* GetShutDownEvent() = 0;
+ virtual scoped_ptr<base::SharedMemory> AllocateSharedMemory(uint32 size) = 0;
+ virtual int32 CreateViewCommandBuffer(
+ int32 surface_id, const GPUCreateCommandBufferConfig& init_params) = 0;
+ virtual GpuChannelHost* EstablishGpuChannelSync(
+ content::CauseForGpuLaunch) = 0;
+
+ protected:
+ static void set_instance(GpuChannelHostFactory* instance) {
+ instance_ = instance;
+ }
+
+ private:
+ static GpuChannelHostFactory* instance_;
+};
+
// Encapsulates an IPC channel between the renderer and one plugin process.
// On the plugin side there's a corresponding GpuChannel.
class GpuChannelHost : public IPC::Message::Sender,
@@ -61,7 +89,7 @@ class GpuChannelHost : public IPC::Message::Sender,
};
// Called on the render thread
- GpuChannelHost();
+ explicit GpuChannelHost(GpuChannelHostFactory* factory);
virtual ~GpuChannelHost();
// Connect to GPU process channel.
@@ -128,6 +156,8 @@ class GpuChannelHost : public IPC::Message::Sender,
// the state on this side to lost.
void ForciblyCloseChannel();
+ GpuChannelHostFactory* factory() const { return factory_; }
+
private:
// A filter used internally to route incoming messages from the IO thread
// to the correct message loop.
@@ -152,6 +182,8 @@ class GpuChannelHost : public IPC::Message::Sender,
ListenerMap listeners_;
};
+ GpuChannelHostFactory* factory_;
+
State state_;
content::GPUInfo gpu_info_;
« no previous file with comments | « content/renderer/gpu/command_buffer_proxy.cc ('k') | content/renderer/gpu/gpu_channel_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698