OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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/renderer/gpu/gpu_surface_proxy.h" | 5 #include "content/renderer/gpu/gpu_surface_proxy.h" |
6 #include "ui/gfx/size.h" | 6 #include "ui/gfx/size.h" |
7 | 7 |
8 GpuSurfaceProxy::GpuSurfaceProxy( | 8 GpuSurfaceProxy::GpuSurfaceProxy( |
9 IPC::Channel::Sender* channel, | 9 IPC::Channel::Sender* channel, |
10 int route_id) | 10 int route_id) |
11 : channel_(channel), | 11 : channel_(channel), |
12 route_id_(route_id) { | 12 route_id_(route_id) { |
13 } | 13 } |
14 | 14 |
15 GpuSurfaceProxy::~GpuSurfaceProxy() { | 15 GpuSurfaceProxy::~GpuSurfaceProxy() { |
16 } | 16 } |
17 | 17 |
18 bool GpuSurfaceProxy::OnMessageReceived(const IPC::Message& message) { | 18 bool GpuSurfaceProxy::OnMessageReceived(const IPC::Message& message) { |
| 19 if (IsOrphaned()) |
| 20 return false; |
| 21 |
19 bool handled = true; | 22 bool handled = true; |
20 //IPC_BEGIN_MESSAGE_MAP(GpuSurfaceProxy, message) | 23 //IPC_BEGIN_MESSAGE_MAP(GpuSurfaceProxy, message) |
21 // IPC_MESSAGE_UNHANDLED(handled = false) | 24 // IPC_MESSAGE_UNHANDLED(handled = false) |
22 //IPC_END_MESSAGE_MAP() | 25 //IPC_END_MESSAGE_MAP() |
23 DCHECK(handled); | 26 DCHECK(handled); |
24 return handled; | 27 return handled; |
25 } | 28 } |
26 | 29 |
27 void GpuSurfaceProxy::OnChannelError() { | 30 void GpuSurfaceProxy::OnChannelError() { |
28 // Prevent any further messages from being sent. | 31 // Prevent any further messages from being sent. |
29 channel_ = NULL; | 32 channel_ = NULL; |
30 } | 33 } |
OLD | NEW |