| 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 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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; |
| OLD | NEW |