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