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

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

Issue 297973002: Navigation transitions: Block first response until after transitions have run. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 6 years, 6 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_manager.h" 5 #include "content/browser/frame_host/render_frame_host_manager.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 pending_nav_params_.reset(new PendingNavigationParams( 350 pending_nav_params_.reset(new PendingNavigationParams(
351 global_request_id, cross_site_transferring_request.Pass(), 351 global_request_id, cross_site_transferring_request.Pass(),
352 transfer_url_chain, referrer, page_transition, 352 transfer_url_chain, referrer, page_transition,
353 pending_render_frame_host->GetRoutingID(), 353 pending_render_frame_host->GetRoutingID(),
354 should_replace_current_entry)); 354 should_replace_current_entry));
355 355
356 // Run the unload handler of the current page. 356 // Run the unload handler of the current page.
357 SwapOutOldPage(); 357 SwapOutOldPage();
358 } 358 }
359 359
360 void RenderFrameHostManager::OnDeferredAfterResponseStarted(
361 const GlobalRequestID& global_request_id,
362 RenderFrameHostImpl* pending_render_frame_host) {
363 DCHECK(!response_started_id_.get());
364
365 response_started_id_.reset(new GlobalRequestID(global_request_id));
366 }
367
368 void RenderFrameHostManager::ResumeResponseDeferredAtStart() {
369 DCHECK(response_started_id_.get());
370
371 RenderProcessHostImpl* process =
372 static_cast<RenderProcessHostImpl*>(render_frame_host_->GetProcess());
373 process->ResumeResponseDeferredAtStart(*response_started_id_);
374
375 render_frame_host_->SetHasPendingTransitionRequest(false);
376
377 response_started_id_.reset();
378 }
379
360 void RenderFrameHostManager::SwappedOut( 380 void RenderFrameHostManager::SwappedOut(
361 RenderFrameHostImpl* render_frame_host) { 381 RenderFrameHostImpl* render_frame_host) {
362 // Make sure this is from our current RFH, and that we have a pending 382 // Make sure this is from our current RFH, and that we have a pending
363 // navigation from OnCrossSiteResponse. (There may be no pending navigation 383 // navigation from OnCrossSiteResponse. (There may be no pending navigation
364 // for data URLs that don't make network requests, for example.) If not, 384 // for data URLs that don't make network requests, for example.) If not,
365 // just return early and ignore. 385 // just return early and ignore.
366 if (render_frame_host != render_frame_host_ || !pending_nav_params_.get()) { 386 if (render_frame_host != render_frame_host_ || !pending_nav_params_.get()) {
367 pending_nav_params_.reset(); 387 pending_nav_params_.reset();
368 return; 388 return;
369 } 389 }
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after
1462 SiteInstance* instance) const { 1482 SiteInstance* instance) const {
1463 RenderFrameProxyHostMap::const_iterator iter = 1483 RenderFrameProxyHostMap::const_iterator iter =
1464 proxy_hosts_.find(instance->GetId()); 1484 proxy_hosts_.find(instance->GetId());
1465 if (iter != proxy_hosts_.end()) 1485 if (iter != proxy_hosts_.end())
1466 return iter->second; 1486 return iter->second;
1467 1487
1468 return NULL; 1488 return NULL;
1469 } 1489 }
1470 1490
1471 } // namespace content 1491 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_manager.h ('k') | content/browser/loader/cross_site_resource_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698