| OLD | NEW |
| 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 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 662 GlobalRequestID global_id(params.new_render_process_host_id, | 662 GlobalRequestID global_id(params.new_render_process_host_id, |
| 663 params.new_request_id); | 663 params.new_request_id); |
| 664 PendingRequestList::iterator i = pending_requests_.find(global_id); | 664 PendingRequestList::iterator i = pending_requests_.find(global_id); |
| 665 if (i != pending_requests_.end()) { | 665 if (i != pending_requests_.end()) { |
| 666 // The response we were meant to resume could have already been canceled. | 666 // The response we were meant to resume could have already been canceled. |
| 667 ResourceDispatcherHostRequestInfo* info = InfoForRequest(i->second); | 667 ResourceDispatcherHostRequestInfo* info = InfoForRequest(i->second); |
| 668 if (info->cross_site_handler()) | 668 if (info->cross_site_handler()) |
| 669 info->cross_site_handler()->ResumeResponse(); | 669 info->cross_site_handler()->ResumeResponse(); |
| 670 } | 670 } |
| 671 } else { | 671 } else { |
| 672 // This is a tab close, so just forward the message to close it. | 672 // This is a tab close, so we will close the tab in OnClosePageACK. |
| 673 DCHECK(params.new_render_process_host_id == -1); | 673 DCHECK(params.new_render_process_host_id == -1); |
| 674 DCHECK(params.new_request_id == -1); | 674 DCHECK(params.new_request_id == -1); |
| 675 CallRenderViewHost(params.closing_process_id, | |
| 676 params.closing_route_id, | |
| 677 &RenderViewHost::ClosePageIgnoringUnloadEvents); | |
| 678 } | 675 } |
| 676 // Update the RenderViewHost's internal state after the ACK. |
| 677 CallRenderViewHost(params.closing_process_id, |
| 678 params.closing_route_id, |
| 679 &RenderViewHost::OnClosePageACK, |
| 680 params.for_cross_site_transition); |
| 679 } | 681 } |
| 680 | 682 |
| 681 // We are explicitly forcing the download of 'url'. | 683 // We are explicitly forcing the download of 'url'. |
| 682 void ResourceDispatcherHost::BeginDownload( | 684 void ResourceDispatcherHost::BeginDownload( |
| 683 const GURL& url, | 685 const GURL& url, |
| 684 const GURL& referrer, | 686 const GURL& referrer, |
| 685 const DownloadSaveInfo& save_info, | 687 const DownloadSaveInfo& save_info, |
| 686 bool prompt_for_save_location, | 688 bool prompt_for_save_location, |
| 687 int child_id, | 689 int child_id, |
| 688 int route_id, | 690 int route_id, |
| (...skipping 1265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1954 return is_prefetch_enabled_; | 1956 return is_prefetch_enabled_; |
| 1955 } | 1957 } |
| 1956 | 1958 |
| 1957 // static | 1959 // static |
| 1958 void ResourceDispatcherHost::set_is_prefetch_enabled(bool value) { | 1960 void ResourceDispatcherHost::set_is_prefetch_enabled(bool value) { |
| 1959 is_prefetch_enabled_ = value; | 1961 is_prefetch_enabled_ = value; |
| 1960 } | 1962 } |
| 1961 | 1963 |
| 1962 // static | 1964 // static |
| 1963 bool ResourceDispatcherHost::is_prefetch_enabled_ = false; | 1965 bool ResourceDispatcherHost::is_prefetch_enabled_ = false; |
| OLD | NEW |