OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/frame_host/render_frame_host_impl.h" | 5 #include "content/browser/frame_host/render_frame_host_impl.h" |
6 | 6 |
7 #include "base/containers/hash_tables.h" | 7 #include "base/containers/hash_tables.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/metrics/user_metrics_action.h" | 9 #include "base/metrics/user_metrics_action.h" |
10 #include "content/browser/frame_host/cross_process_frame_connector.h" | 10 #include "content/browser/frame_host/cross_process_frame_connector.h" |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 true, render_view_host_->send_should_close_start_time_, | 236 true, render_view_host_->send_should_close_start_time_, |
237 base::TimeTicks::Now()); | 237 base::TimeTicks::Now()); |
238 return; | 238 return; |
239 } | 239 } |
240 | 240 |
241 // If we're waiting for an unload ack from this renderer and we receive a | 241 // If we're waiting for an unload ack from this renderer and we receive a |
242 // Navigate message, then the renderer was navigating before it received the | 242 // Navigate message, then the renderer was navigating before it received the |
243 // unload request. It will either respond to the unload request soon or our | 243 // unload request. It will either respond to the unload request soon or our |
244 // timer will expire. Either way, we should ignore this message, because we | 244 // timer will expire. Either way, we should ignore this message, because we |
245 // have already committed to closing this renderer. | 245 // have already committed to closing this renderer. |
246 if (render_view_host_->is_waiting_for_unload_ack_) | 246 if (render_view_host_->IsWaitingForUnloadACK()) |
247 return; | 247 return; |
248 | 248 |
249 RenderProcessHost* process = GetProcess(); | 249 RenderProcessHost* process = GetProcess(); |
250 | 250 |
251 // Attempts to commit certain off-limits URL should be caught more strictly | 251 // Attempts to commit certain off-limits URL should be caught more strictly |
252 // than our FilterURL checks below. If a renderer violates this policy, it | 252 // than our FilterURL checks below. If a renderer violates this policy, it |
253 // should be killed. | 253 // should be killed. |
254 if (!CanCommitURL(validated_params.url)) { | 254 if (!CanCommitURL(validated_params.url)) { |
255 VLOG(1) << "Blocked URL " << validated_params.url.spec(); | 255 VLOG(1) << "Blocked URL " << validated_params.url.spec(); |
256 validated_params.url = GURL(kAboutBlankURL); | 256 validated_params.url = GURL(kAboutBlankURL); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 // We don't validate |unfiltered_link_url| so that this field can be used | 324 // We don't validate |unfiltered_link_url| so that this field can be used |
325 // when users want to copy the original link URL. | 325 // when users want to copy the original link URL. |
326 process->FilterURL(true, &validated_params.link_url); | 326 process->FilterURL(true, &validated_params.link_url); |
327 process->FilterURL(true, &validated_params.src_url); | 327 process->FilterURL(true, &validated_params.src_url); |
328 process->FilterURL(false, &validated_params.page_url); | 328 process->FilterURL(false, &validated_params.page_url); |
329 process->FilterURL(true, &validated_params.frame_url); | 329 process->FilterURL(true, &validated_params.frame_url); |
330 | 330 |
331 delegate_->ShowContextMenu(this, validated_params); | 331 delegate_->ShowContextMenu(this, validated_params); |
332 } | 332 } |
333 | 333 |
| 334 void RenderFrameHostImpl::SetPendingShutdown(const base::Closure& on_swap_out) { |
| 335 render_view_host_->SetPendingShutdown(on_swap_out); |
| 336 } |
| 337 |
334 bool RenderFrameHostImpl::CanCommitURL(const GURL& url) { | 338 bool RenderFrameHostImpl::CanCommitURL(const GURL& url) { |
335 // TODO(creis): We should also check for WebUI pages here. Also, when the | 339 // TODO(creis): We should also check for WebUI pages here. Also, when the |
336 // out-of-process iframes implementation is ready, we should check for | 340 // out-of-process iframes implementation is ready, we should check for |
337 // cross-site URLs that are not allowed to commit in this process. | 341 // cross-site URLs that are not allowed to commit in this process. |
338 | 342 |
339 // Give the client a chance to disallow URLs from committing. | 343 // Give the client a chance to disallow URLs from committing. |
340 return GetContentClient()->browser()->CanCommitURL(GetProcess(), url); | 344 return GetContentClient()->browser()->CanCommitURL(GetProcess(), url); |
341 } | 345 } |
342 | 346 |
343 } // namespace content | 347 } // namespace content |
OLD | NEW |