Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 180993003: Revert "Revert 249676 "Have the unload event execute in background on cr..."" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Delete RFH pending shutdown in all nodes of the FrameTree Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.h ('k') | content/browser/frame_host/render_frame_host_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698