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 #include "content/browser/renderer_host/render_message_filter.h" | 5 #include "content/browser/renderer_host/render_message_filter.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 : RenderMessageCompletionCallback(filter, reply_msg), | 123 : RenderMessageCompletionCallback(filter, reply_msg), |
124 context_(context) { | 124 context_(context) { |
125 } | 125 } |
126 | 126 |
127 virtual void GetPpapiChannelInfo(base::ProcessHandle* renderer_handle, | 127 virtual void GetPpapiChannelInfo(base::ProcessHandle* renderer_handle, |
128 int* renderer_id) { | 128 int* renderer_id) { |
129 *renderer_handle = filter()->peer_handle(); | 129 *renderer_handle = filter()->peer_handle(); |
130 *renderer_id = filter()->render_process_id(); | 130 *renderer_id = filter()->render_process_id(); |
131 } | 131 } |
132 | 132 |
133 virtual void OnPpapiChannelOpened(base::ProcessHandle plugin_process_handle, | 133 virtual void OnPpapiChannelOpened(const IPC::ChannelHandle& channel_handle, |
134 const IPC::ChannelHandle& channel_handle, | |
135 int plugin_child_id) { | 134 int plugin_child_id) { |
136 ViewHostMsg_OpenChannelToPepperPlugin::WriteReplyParams( | 135 ViewHostMsg_OpenChannelToPepperPlugin::WriteReplyParams( |
137 reply_msg(), plugin_process_handle, channel_handle, plugin_child_id); | 136 reply_msg(), channel_handle, plugin_child_id); |
138 SendReplyAndDeleteThis(); | 137 SendReplyAndDeleteThis(); |
139 } | 138 } |
140 | 139 |
141 virtual bool OffTheRecord() { | 140 virtual bool OffTheRecord() { |
142 return filter()->OffTheRecord(); | 141 return filter()->OffTheRecord(); |
143 } | 142 } |
144 | 143 |
145 virtual content::ResourceContext* GetResourceContext() { | 144 virtual content::ResourceContext* GetResourceContext() { |
146 return context_; | 145 return context_; |
147 } | 146 } |
(...skipping 14 matching lines...) Expand all Loading... |
162 } | 161 } |
163 | 162 |
164 virtual ~OpenChannelToPpapiBrokerCallback() {} | 163 virtual ~OpenChannelToPpapiBrokerCallback() {} |
165 | 164 |
166 virtual void GetPpapiChannelInfo(base::ProcessHandle* renderer_handle, | 165 virtual void GetPpapiChannelInfo(base::ProcessHandle* renderer_handle, |
167 int* renderer_id) { | 166 int* renderer_id) { |
168 *renderer_handle = filter_->peer_handle(); | 167 *renderer_handle = filter_->peer_handle(); |
169 *renderer_id = filter_->render_process_id(); | 168 *renderer_id = filter_->render_process_id(); |
170 } | 169 } |
171 | 170 |
172 virtual void OnPpapiChannelOpened(base::ProcessHandle broker_process_handle, | 171 virtual void OnPpapiChannelOpened(const IPC::ChannelHandle& channel_handle, |
173 const IPC::ChannelHandle& channel_handle, | |
174 int /* plugin_child_id */) { | 172 int /* plugin_child_id */) { |
175 filter_->Send(new ViewMsg_PpapiBrokerChannelCreated(routing_id_, | 173 filter_->Send(new ViewMsg_PpapiBrokerChannelCreated(routing_id_, |
176 request_id_, | 174 request_id_, |
177 broker_process_handle, | |
178 channel_handle)); | 175 channel_handle)); |
179 delete this; | 176 delete this; |
180 } | 177 } |
181 | 178 |
182 virtual bool OffTheRecord() { | 179 virtual bool OffTheRecord() { |
183 return filter_->OffTheRecord(); | 180 return filter_->OffTheRecord(); |
184 } | 181 } |
185 | 182 |
186 private: | 183 private: |
187 scoped_refptr<RenderMessageFilter> filter_; | 184 scoped_refptr<RenderMessageFilter> filter_; |
(...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
951 // for a resize or if no backing store) the RenderWidgetHost is blocking the | 948 // for a resize or if no backing store) the RenderWidgetHost is blocking the |
952 // UI thread for some time, waiting for an UpdateRect from the renderer. If we | 949 // UI thread for some time, waiting for an UpdateRect from the renderer. If we |
953 // are going to switch to accelerated compositing, the GPU process may need | 950 // are going to switch to accelerated compositing, the GPU process may need |
954 // round-trips to the UI thread before finishing the frame, causing deadlocks | 951 // round-trips to the UI thread before finishing the frame, causing deadlocks |
955 // if we delay the UpdateRect until we receive the OnSwapBuffersComplete. So | 952 // if we delay the UpdateRect until we receive the OnSwapBuffersComplete. So |
956 // the renderer sent us this message, so that we can unblock the UI thread. | 953 // the renderer sent us this message, so that we can unblock the UI thread. |
957 // We will simply re-use the UpdateRect unblock mechanism, just with a | 954 // We will simply re-use the UpdateRect unblock mechanism, just with a |
958 // different message. | 955 // different message. |
959 render_widget_helper_->DidReceiveBackingStoreMsg(msg); | 956 render_widget_helper_->DidReceiveBackingStoreMsg(msg); |
960 } | 957 } |
OLD | NEW |