OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CONTENT_BROWSER_RENDERER_HOST_GPU_MESSAGE_FILTER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_GPU_MESSAGE_FILTER_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_GPU_MESSAGE_FILTER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_GPU_MESSAGE_FILTER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/linked_ptr.h" | 10 #include "base/memory/linked_ptr.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "base/sequenced_task_runner_helpers.h" | 14 #include "base/sequenced_task_runner_helpers.h" |
15 #include "content/common/gpu/gpu_process_launch_causes.h" | 15 #include "content/common/gpu/gpu_process_launch_causes.h" |
16 #include "content/public/browser/browser_message_filter.h" | 16 #include "content/public/browser/browser_message_filter.h" |
17 #include "ui/gfx/native_widget_types.h" | 17 #include "ui/gfx/native_widget_types.h" |
18 | 18 |
19 class GpuProcessHost; | |
20 struct GPUCreateCommandBufferConfig; | 19 struct GPUCreateCommandBufferConfig; |
21 | 20 |
22 namespace gpu { | 21 namespace gpu { |
23 struct GPUInfo; | 22 struct GPUInfo; |
24 } | 23 } |
25 | 24 |
26 namespace content { | 25 namespace content { |
| 26 class GpuProcessHost; |
27 class RenderWidgetHelper; | 27 class RenderWidgetHelper; |
28 class RenderWidgetHostViewFrameSubscriber; | 28 class RenderWidgetHostViewFrameSubscriber; |
29 | 29 |
30 // A message filter for messages from the renderer to the GpuProcessHost(UIShim) | 30 // A message filter for messages from the renderer to the GpuProcessHost(UIShim) |
31 // in the browser. Such messages are typically destined for the GPU process, | 31 // in the browser. Such messages are typically destined for the GPU process, |
32 // but need to be mediated by the browser. | 32 // but need to be mediated by the browser. |
33 class GpuMessageFilter : public BrowserMessageFilter { | 33 class GpuMessageFilter : public BrowserMessageFilter { |
34 public: | 34 public: |
35 GpuMessageFilter(int render_process_id, | 35 GpuMessageFilter(int render_process_id, |
36 RenderWidgetHelper* render_widget_helper); | 36 RenderWidgetHelper* render_widget_helper); |
(...skipping 10 matching lines...) Expand all Loading... |
47 void EndFrameSubscription(int route_id); | 47 void EndFrameSubscription(int route_id); |
48 | 48 |
49 private: | 49 private: |
50 friend class BrowserThread; | 50 friend class BrowserThread; |
51 friend class base::DeleteHelper<GpuMessageFilter>; | 51 friend class base::DeleteHelper<GpuMessageFilter>; |
52 struct CreateViewCommandBufferRequest; | 52 struct CreateViewCommandBufferRequest; |
53 struct FrameSubscription; | 53 struct FrameSubscription; |
54 | 54 |
55 virtual ~GpuMessageFilter(); | 55 virtual ~GpuMessageFilter(); |
56 | 56 |
| 57 GpuProcessHost* GetGpuProcessHost(CauseForGpuLaunch cause_for_gpu_launch); |
| 58 |
57 // Message handlers called on the browser IO thread: | 59 // Message handlers called on the browser IO thread: |
58 void OnEstablishGpuChannel(CauseForGpuLaunch, | 60 void OnEstablishGpuChannel(CauseForGpuLaunch, |
59 IPC::Message* reply); | 61 IPC::Message* reply); |
60 void OnCreateViewCommandBuffer( | 62 void OnCreateViewCommandBuffer( |
61 int32 surface_id, | 63 int32 surface_id, |
62 const GPUCreateCommandBufferConfig& init_params, | 64 const GPUCreateCommandBufferConfig& init_params, |
63 int32 route_id, | 65 int32 route_id, |
64 IPC::Message* reply); | 66 IPC::Message* reply); |
65 // Helper callbacks for the message handlers. | 67 // Helper callbacks for the message handlers. |
66 void EstablishChannelCallback(scoped_ptr<IPC::Message> reply, | 68 void EstablishChannelCallback(scoped_ptr<IPC::Message> reply, |
(...skipping 18 matching lines...) Expand all Loading... |
85 | 87 |
86 typedef std::vector<linked_ptr<FrameSubscription> > FrameSubscriptionList; | 88 typedef std::vector<linked_ptr<FrameSubscription> > FrameSubscriptionList; |
87 FrameSubscriptionList frame_subscription_list_; | 89 FrameSubscriptionList frame_subscription_list_; |
88 | 90 |
89 DISALLOW_COPY_AND_ASSIGN(GpuMessageFilter); | 91 DISALLOW_COPY_AND_ASSIGN(GpuMessageFilter); |
90 }; | 92 }; |
91 | 93 |
92 } // namespace content | 94 } // namespace content |
93 | 95 |
94 #endif // CONTENT_BROWSER_RENDERER_HOST_GPU_MESSAGE_FILTER_H_ | 96 #endif // CONTENT_BROWSER_RENDERER_HOST_GPU_MESSAGE_FILTER_H_ |
OLD | NEW |