OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_BROWSER_GPU_PROCESS_HOST_H_ | 5 #ifndef CHROME_BROWSER_GPU_PROCESS_HOST_H_ |
6 #define CHROME_BROWSER_GPU_PROCESS_HOST_H_ | 6 #define CHROME_BROWSER_GPU_PROCESS_HOST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <queue> | 9 #include <queue> |
10 | 10 |
(...skipping 32 matching lines...) Loading... |
43 void EstablishGpuChannel(int renderer_id, | 43 void EstablishGpuChannel(int renderer_id, |
44 ResourceMessageFilter* filter); | 44 ResourceMessageFilter* filter); |
45 | 45 |
46 // Sends a reply message later when the next GpuHostMsg_SynchronizeReply comes | 46 // Sends a reply message later when the next GpuHostMsg_SynchronizeReply comes |
47 // in. | 47 // in. |
48 void Synchronize(IPC::Message* reply, | 48 void Synchronize(IPC::Message* reply, |
49 ResourceMessageFilter* filter); | 49 ResourceMessageFilter* filter); |
50 | 50 |
51 // Return the stored gpu_info as this class the | 51 // Return the stored gpu_info as this class the |
52 // browser's point of contact with the gpu | 52 // browser's point of contact with the gpu |
53 GPUInfo gpu_info() const; | 53 const GPUInfo& gpu_info() const; |
| 54 |
54 private: | 55 private: |
55 // Used to queue pending channel requests. | 56 // Used to queue pending channel requests. |
56 struct ChannelRequest { | 57 struct ChannelRequest { |
57 explicit ChannelRequest(ResourceMessageFilter* filter); | 58 explicit ChannelRequest(ResourceMessageFilter* filter); |
58 ~ChannelRequest(); | 59 ~ChannelRequest(); |
59 | 60 |
60 // Used to send the reply message back to the renderer. | 61 // Used to send the reply message back to the renderer. |
61 scoped_refptr<ResourceMessageFilter> filter; | 62 scoped_refptr<ResourceMessageFilter> filter; |
62 }; | 63 }; |
63 | 64 |
(...skipping 28 matching lines...) Loading... |
92 void OnGetViewXID(gfx::NativeViewId id, IPC::Message* reply_msg); | 93 void OnGetViewXID(gfx::NativeViewId id, IPC::Message* reply_msg); |
93 #elif defined(OS_MACOSX) | 94 #elif defined(OS_MACOSX) |
94 void OnAcceleratedSurfaceSetIOSurface( | 95 void OnAcceleratedSurfaceSetIOSurface( |
95 const GpuHostMsg_AcceleratedSurfaceSetIOSurface_Params& params); | 96 const GpuHostMsg_AcceleratedSurfaceSetIOSurface_Params& params); |
96 void OnAcceleratedSurfaceBuffersSwapped(int32 renderer_id, | 97 void OnAcceleratedSurfaceBuffersSwapped(int32 renderer_id, |
97 int32 render_view_id, | 98 int32 render_view_id, |
98 gfx::PluginWindowHandle window, | 99 gfx::PluginWindowHandle window, |
99 uint64 surface_id); | 100 uint64 surface_id); |
100 #endif | 101 #endif |
101 | 102 |
102 void ReplyToRenderer(const IPC::ChannelHandle& channel, | 103 // Sends the response for establish channel request to the renderer. |
103 const GPUInfo& gpu_info, | 104 void SendEstablishChannelReply(const IPC::ChannelHandle& channel, |
104 ResourceMessageFilter* filter); | 105 const GPUInfo& gpu_info, |
| 106 ResourceMessageFilter* filter); |
| 107 // Sends the response for synchronization request to the renderer. |
| 108 void SendSynchronizationReply(IPC::Message* reply, |
| 109 ResourceMessageFilter* filter); |
105 | 110 |
106 // ResourceDispatcherHost::Receiver implementation: | 111 // ResourceDispatcherHost::Receiver implementation: |
107 virtual URLRequestContext* GetRequestContext( | 112 virtual URLRequestContext* GetRequestContext( |
108 uint32 request_id, | 113 uint32 request_id, |
109 const ViewHostMsg_Resource_Request& request_data); | 114 const ViewHostMsg_Resource_Request& request_data); |
110 | 115 |
111 virtual bool CanShutdown(); | 116 virtual bool CanShutdown(); |
| 117 virtual void OnProcessCrashed(); |
112 | 118 |
113 bool initialized_; | 119 bool initialized_; |
114 bool initialized_successfully_; | 120 bool initialized_successfully_; |
115 | 121 |
116 // GPUInfo class used for collecting gpu stats | 122 // GPUInfo class used for collecting gpu stats |
117 GPUInfo gpu_info_; | 123 GPUInfo gpu_info_; |
118 | 124 |
119 // These are the channel requests that we have already sent to | 125 // These are the channel requests that we have already sent to |
120 // the GPU process, but haven't heard back about yet. | 126 // the GPU process, but haven't heard back about yet. |
121 std::queue<ChannelRequest> sent_requests_; | 127 std::queue<ChannelRequest> sent_requests_; |
122 | 128 |
123 // The pending synchronization requests we need to reply to. | 129 // The pending synchronization requests we need to reply to. |
124 std::queue<SynchronizationRequest> queued_synchronization_replies_; | 130 std::queue<SynchronizationRequest> queued_synchronization_replies_; |
125 | 131 |
126 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); | 132 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); |
127 }; | 133 }; |
128 | 134 |
129 #endif // CHROME_BROWSER_GPU_PROCESS_HOST_H_ | 135 #endif // CHROME_BROWSER_GPU_PROCESS_HOST_H_ |
OLD | NEW |