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

Side by Side Diff: content/browser/renderer_host/resource_dispatcher_host.cc

Issue 6724026: Clean up unload-related state after the ack is received. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with test flakiness fix CL. Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading
6 6
7 #include "content/browser/renderer_host/resource_dispatcher_host.h" 7 #include "content/browser/renderer_host/resource_dispatcher_host.h"
8 8
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 GlobalRequestID global_id(params.new_render_process_host_id, 652 GlobalRequestID global_id(params.new_render_process_host_id,
653 params.new_request_id); 653 params.new_request_id);
654 PendingRequestList::iterator i = pending_requests_.find(global_id); 654 PendingRequestList::iterator i = pending_requests_.find(global_id);
655 if (i != pending_requests_.end()) { 655 if (i != pending_requests_.end()) {
656 // The response we were meant to resume could have already been canceled. 656 // The response we were meant to resume could have already been canceled.
657 ResourceDispatcherHostRequestInfo* info = InfoForRequest(i->second); 657 ResourceDispatcherHostRequestInfo* info = InfoForRequest(i->second);
658 if (info->cross_site_handler()) 658 if (info->cross_site_handler())
659 info->cross_site_handler()->ResumeResponse(); 659 info->cross_site_handler()->ResumeResponse();
660 } 660 }
661 } else { 661 } else {
662 // This is a tab close, so just forward the message to close it. 662 // This is a tab close, so we will close the tab in OnClosePageACK.
663 DCHECK(params.new_render_process_host_id == -1); 663 DCHECK(params.new_render_process_host_id == -1);
664 DCHECK(params.new_request_id == -1); 664 DCHECK(params.new_request_id == -1);
665 CallRenderViewHost(params.closing_process_id,
666 params.closing_route_id,
667 &RenderViewHost::ClosePageIgnoringUnloadEvents);
668 } 665 }
666 // Update the RenderViewHost's internal state after the ACK.
667 CallRenderViewHost(params.closing_process_id,
668 params.closing_route_id,
669 &RenderViewHost::OnClosePageACK,
670 params.for_cross_site_transition);
669 } 671 }
670 672
671 // We are explicitly forcing the download of 'url'. 673 // We are explicitly forcing the download of 'url'.
672 void ResourceDispatcherHost::BeginDownload( 674 void ResourceDispatcherHost::BeginDownload(
673 const GURL& url, 675 const GURL& url,
674 const GURL& referrer, 676 const GURL& referrer,
675 const DownloadSaveInfo& save_info, 677 const DownloadSaveInfo& save_info,
676 bool prompt_for_save_location, 678 bool prompt_for_save_location,
677 int child_id, 679 int child_id,
678 int route_id, 680 int route_id,
(...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after
1948 return is_prefetch_enabled_; 1950 return is_prefetch_enabled_;
1949 } 1951 }
1950 1952
1951 // static 1953 // static
1952 void ResourceDispatcherHost::set_is_prefetch_enabled(bool value) { 1954 void ResourceDispatcherHost::set_is_prefetch_enabled(bool value) {
1953 is_prefetch_enabled_ = value; 1955 is_prefetch_enabled_ = value;
1954 } 1956 }
1955 1957
1956 // static 1958 // static
1957 bool ResourceDispatcherHost::is_prefetch_enabled_ = false; 1959 bool ResourceDispatcherHost::is_prefetch_enabled_ = false;
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_view_host_manager_browsertest.cc ('k') | net/tools/testserver/testserver.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698