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/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/posix/eintr_wrapper.h" | 10 #include "base/posix/eintr_wrapper.h" |
(...skipping 118 matching lines...) Loading... |
129 | 129 |
130 void RenderWidgetHelper::ResumeDeferredNavigation( | 130 void RenderWidgetHelper::ResumeDeferredNavigation( |
131 const GlobalRequestID& request_id) { | 131 const GlobalRequestID& request_id) { |
132 BrowserThread::PostTask( | 132 BrowserThread::PostTask( |
133 BrowserThread::IO, FROM_HERE, | 133 BrowserThread::IO, FROM_HERE, |
134 base::Bind(&RenderWidgetHelper::OnResumeDeferredNavigation, | 134 base::Bind(&RenderWidgetHelper::OnResumeDeferredNavigation, |
135 this, | 135 this, |
136 request_id)); | 136 request_id)); |
137 } | 137 } |
138 | 138 |
| 139 void RenderWidgetHelper::ResumeResponseDeferredAtStart( |
| 140 const GlobalRequestID& request_id) { |
| 141 BrowserThread::PostTask( |
| 142 BrowserThread::IO, FROM_HERE, |
| 143 base::Bind(&RenderWidgetHelper::OnResumeResponseDeferredAtStart, |
| 144 this, |
| 145 request_id)); |
| 146 } |
| 147 |
139 bool RenderWidgetHelper::WaitForBackingStoreMsg( | 148 bool RenderWidgetHelper::WaitForBackingStoreMsg( |
140 int render_widget_id, const base::TimeDelta& max_delay, IPC::Message* msg) { | 149 int render_widget_id, const base::TimeDelta& max_delay, IPC::Message* msg) { |
141 base::TimeTicks time_start = base::TimeTicks::Now(); | 150 base::TimeTicks time_start = base::TimeTicks::Now(); |
142 | 151 |
143 for (;;) { | 152 for (;;) { |
144 BackingStoreMsgProxy* proxy = NULL; | 153 BackingStoreMsgProxy* proxy = NULL; |
145 { | 154 { |
146 base::AutoLock lock(pending_paints_lock_); | 155 base::AutoLock lock(pending_paints_lock_); |
147 | 156 |
148 BackingStoreMsgProxyMap::iterator it = | 157 BackingStoreMsgProxyMap::iterator it = |
(...skipping 89 matching lines...) Loading... |
238 RenderProcessHost* host = RenderProcessHost::FromID(render_process_id_); | 247 RenderProcessHost* host = RenderProcessHost::FromID(render_process_id_); |
239 if (host) | 248 if (host) |
240 host->OnMessageReceived(proxy->message()); | 249 host->OnMessageReceived(proxy->message()); |
241 } | 250 } |
242 | 251 |
243 void RenderWidgetHelper::OnResumeDeferredNavigation( | 252 void RenderWidgetHelper::OnResumeDeferredNavigation( |
244 const GlobalRequestID& request_id) { | 253 const GlobalRequestID& request_id) { |
245 resource_dispatcher_host_->ResumeDeferredNavigation(request_id); | 254 resource_dispatcher_host_->ResumeDeferredNavigation(request_id); |
246 } | 255 } |
247 | 256 |
| 257 void RenderWidgetHelper::OnResumeResponseDeferredAtStart( |
| 258 const GlobalRequestID& request_id) { |
| 259 resource_dispatcher_host_->ResumeResponseDeferredAtStart(request_id); |
| 260 } |
| 261 |
248 void RenderWidgetHelper::CreateNewWindow( | 262 void RenderWidgetHelper::CreateNewWindow( |
249 const ViewHostMsg_CreateWindow_Params& params, | 263 const ViewHostMsg_CreateWindow_Params& params, |
250 bool no_javascript_access, | 264 bool no_javascript_access, |
251 base::ProcessHandle render_process, | 265 base::ProcessHandle render_process, |
252 int* route_id, | 266 int* route_id, |
253 int* main_frame_route_id, | 267 int* main_frame_route_id, |
254 int* surface_id, | 268 int* surface_id, |
255 SessionStorageNamespace* session_storage_namespace) { | 269 SessionStorageNamespace* session_storage_namespace) { |
256 if (params.opener_suppressed || no_javascript_access) { | 270 if (params.opener_suppressed || no_javascript_access) { |
257 // If the opener is supppressed or script access is disallowed, we should | 271 // If the opener is supppressed or script access is disallowed, we should |
(...skipping 124 matching lines...) Loading... |
382 i = allocated_dibs_.begin(); i != allocated_dibs_.end(); ++i) { | 396 i = allocated_dibs_.begin(); i != allocated_dibs_.end(); ++i) { |
383 if (IGNORE_EINTR(close(i->second)) < 0) | 397 if (IGNORE_EINTR(close(i->second)) < 0) |
384 PLOG(ERROR) << "close: " << i->first; | 398 PLOG(ERROR) << "close: " << i->first; |
385 } | 399 } |
386 | 400 |
387 allocated_dibs_.clear(); | 401 allocated_dibs_.clear(); |
388 } | 402 } |
389 #endif | 403 #endif |
390 | 404 |
391 } // namespace content | 405 } // namespace content |
OLD | NEW |