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_widget_helper.h" | 5 #include "content/browser/renderer_host/render_widget_helper.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/eintr_wrapper.h" | 9 #include "base/eintr_wrapper.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 if (render_process_id_ == -1) | 131 if (render_process_id_ == -1) |
132 return; | 132 return; |
133 | 133 |
134 BrowserThread::PostTask( | 134 BrowserThread::PostTask( |
135 BrowserThread::IO, FROM_HERE, | 135 BrowserThread::IO, FROM_HERE, |
136 base::Bind(&RenderWidgetHelper::OnCancelResourceRequests, | 136 base::Bind(&RenderWidgetHelper::OnCancelResourceRequests, |
137 this, | 137 this, |
138 render_widget_id)); | 138 render_widget_id)); |
139 } | 139 } |
140 | 140 |
141 void RenderWidgetHelper::CrossSiteSwapOutACK( | 141 void RenderWidgetHelper::SimulateSwapOutACK( |
142 const ViewMsg_SwapOut_Params& params) { | 142 const ViewMsg_SwapOut_Params& params) { |
143 BrowserThread::PostTask( | 143 BrowserThread::PostTask( |
144 BrowserThread::IO, FROM_HERE, | 144 BrowserThread::IO, FROM_HERE, |
145 base::Bind(&RenderWidgetHelper::OnCrossSiteSwapOutACK, | 145 base::Bind(&RenderWidgetHelper::OnSimulateSwapOutACK, |
146 this, | 146 this, |
147 params)); | 147 params)); |
148 } | 148 } |
149 | 149 |
150 bool RenderWidgetHelper::WaitForBackingStoreMsg( | 150 bool RenderWidgetHelper::WaitForBackingStoreMsg( |
151 int render_widget_id, const base::TimeDelta& max_delay, IPC::Message* msg) { | 151 int render_widget_id, const base::TimeDelta& max_delay, IPC::Message* msg) { |
152 base::TimeTicks time_start = base::TimeTicks::Now(); | 152 base::TimeTicks time_start = base::TimeTicks::Now(); |
153 | 153 |
154 for (;;) { | 154 for (;;) { |
155 BackingStoreMsgProxy* proxy = NULL; | 155 BackingStoreMsgProxy* proxy = NULL; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 if (host) | 250 if (host) |
251 host->OnMessageReceived(proxy->message()); | 251 host->OnMessageReceived(proxy->message()); |
252 } | 252 } |
253 | 253 |
254 void RenderWidgetHelper::OnCancelResourceRequests( | 254 void RenderWidgetHelper::OnCancelResourceRequests( |
255 int render_widget_id) { | 255 int render_widget_id) { |
256 resource_dispatcher_host_->CancelRequestsForRoute( | 256 resource_dispatcher_host_->CancelRequestsForRoute( |
257 render_process_id_, render_widget_id); | 257 render_process_id_, render_widget_id); |
258 } | 258 } |
259 | 259 |
260 void RenderWidgetHelper::OnCrossSiteSwapOutACK( | 260 void RenderWidgetHelper::OnSimulateSwapOutACK( |
261 const ViewMsg_SwapOut_Params& params) { | 261 const ViewMsg_SwapOut_Params& params) { |
262 resource_dispatcher_host_->OnSwapOutACK(params); | 262 resource_dispatcher_host_->OnSimulateSwapOutACK(params); |
263 } | 263 } |
264 | 264 |
265 void RenderWidgetHelper::CreateNewWindow( | 265 void RenderWidgetHelper::CreateNewWindow( |
266 const ViewHostMsg_CreateWindow_Params& params, | 266 const ViewHostMsg_CreateWindow_Params& params, |
267 bool no_javascript_access, | 267 bool no_javascript_access, |
268 base::ProcessHandle render_process, | 268 base::ProcessHandle render_process, |
269 int* route_id, | 269 int* route_id, |
270 int* surface_id, | 270 int* surface_id, |
271 SessionStorageNamespace* session_storage_namespace) { | 271 SessionStorageNamespace* session_storage_namespace) { |
272 if (params.opener_suppressed || no_javascript_access) { | 272 if (params.opener_suppressed || no_javascript_access) { |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 i = allocated_dibs_.begin(); i != allocated_dibs_.end(); ++i) { | 403 i = allocated_dibs_.begin(); i != allocated_dibs_.end(); ++i) { |
404 if (HANDLE_EINTR(close(i->second)) < 0) | 404 if (HANDLE_EINTR(close(i->second)) < 0) |
405 PLOG(ERROR) << "close: " << i->first; | 405 PLOG(ERROR) << "close: " << i->first; |
406 } | 406 } |
407 | 407 |
408 allocated_dibs_.clear(); | 408 allocated_dibs_.clear(); |
409 } | 409 } |
410 #endif | 410 #endif |
411 | 411 |
412 } // namespace content | 412 } // namespace content |
OLD | NEW |