OLD | NEW |
| (Empty) |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_RENDERER_GPU_SURFACE_PROXY_H_ | |
6 #define CONTENT_RENDERER_GPU_SURFACE_PROXY_H_ | |
7 #pragma once | |
8 | |
9 #if defined(ENABLE_GPU) | |
10 | |
11 #include "ipc/ipc_channel.h" | |
12 #include "ipc/ipc_message.h" | |
13 | |
14 namespace gfx { | |
15 class Size; | |
16 } | |
17 | |
18 // Client side proxy that forwards messages to a GpuSurfaceStub. | |
19 class GpuSurfaceProxy : public IPC::Channel::Listener { | |
20 public: | |
21 GpuSurfaceProxy(IPC::Channel::Sender* channel, int route_id); | |
22 virtual ~GpuSurfaceProxy(); | |
23 | |
24 // IPC::Channel::Listener implementation: | |
25 virtual bool OnMessageReceived(const IPC::Message& message); | |
26 virtual void OnChannelError(); | |
27 | |
28 int route_id() const { return route_id_; } | |
29 | |
30 private: | |
31 | |
32 // Send an IPC message over the GPU channel. This is private to fully | |
33 // encapsulate the channel; all callers of this function must explicitly | |
34 // verify that the channel is still available. | |
35 bool Send(IPC::Message* msg); | |
36 | |
37 IPC::Channel::Sender* channel_; | |
38 int route_id_; | |
39 | |
40 DISALLOW_COPY_AND_ASSIGN(GpuSurfaceProxy); | |
41 }; | |
42 | |
43 #endif // ENABLE_GPU | |
44 | |
45 #endif // CONTENT_RENDERER_GPU_SURFACE_PROXY_H_ | |
OLD | NEW |