| 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 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 GlobalRequestID global_id(params.new_render_process_host_id, | 649 GlobalRequestID global_id(params.new_render_process_host_id, |
| 650 params.new_request_id); | 650 params.new_request_id); |
| 651 PendingRequestList::iterator i = pending_requests_.find(global_id); | 651 PendingRequestList::iterator i = pending_requests_.find(global_id); |
| 652 if (i != pending_requests_.end()) { | 652 if (i != pending_requests_.end()) { |
| 653 // The response we were meant to resume could have already been canceled. | 653 // The response we were meant to resume could have already been canceled. |
| 654 ResourceDispatcherHostRequestInfo* info = InfoForRequest(i->second); | 654 ResourceDispatcherHostRequestInfo* info = InfoForRequest(i->second); |
| 655 if (info->cross_site_handler()) | 655 if (info->cross_site_handler()) |
| 656 info->cross_site_handler()->ResumeResponse(); | 656 info->cross_site_handler()->ResumeResponse(); |
| 657 } | 657 } |
| 658 } else { | 658 } else { |
| 659 // This is a tab close, so just forward the message to close it. | 659 // This is a tab close, so we will close the tab in OnClosePageACK. |
| 660 DCHECK(params.new_render_process_host_id == -1); | 660 DCHECK(params.new_render_process_host_id == -1); |
| 661 DCHECK(params.new_request_id == -1); | 661 DCHECK(params.new_request_id == -1); |
| 662 CallRenderViewHost(params.closing_process_id, | |
| 663 params.closing_route_id, | |
| 664 &RenderViewHost::ClosePageIgnoringUnloadEvents); | |
| 665 } | 662 } |
| 663 // Update the RenderViewHost's internal state after the ACK. |
| 664 CallRenderViewHost(params.closing_process_id, |
| 665 params.closing_route_id, |
| 666 &RenderViewHost::OnClosePageACK, |
| 667 params.for_cross_site_transition); |
| 666 } | 668 } |
| 667 | 669 |
| 668 // We are explicitly forcing the download of 'url'. | 670 // We are explicitly forcing the download of 'url'. |
| 669 void ResourceDispatcherHost::BeginDownload( | 671 void ResourceDispatcherHost::BeginDownload( |
| 670 const GURL& url, | 672 const GURL& url, |
| 671 const GURL& referrer, | 673 const GURL& referrer, |
| 672 const DownloadSaveInfo& save_info, | 674 const DownloadSaveInfo& save_info, |
| 673 bool prompt_for_save_location, | 675 bool prompt_for_save_location, |
| 674 int child_id, | 676 int child_id, |
| 675 int route_id, | 677 int route_id, |
| (...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1945 return is_prefetch_enabled_; | 1947 return is_prefetch_enabled_; |
| 1946 } | 1948 } |
| 1947 | 1949 |
| 1948 // static | 1950 // static |
| 1949 void ResourceDispatcherHost::set_is_prefetch_enabled(bool value) { | 1951 void ResourceDispatcherHost::set_is_prefetch_enabled(bool value) { |
| 1950 is_prefetch_enabled_ = value; | 1952 is_prefetch_enabled_ = value; |
| 1951 } | 1953 } |
| 1952 | 1954 |
| 1953 // static | 1955 // static |
| 1954 bool ResourceDispatcherHost::is_prefetch_enabled_ = false; | 1956 bool ResourceDispatcherHost::is_prefetch_enabled_ = false; |
| OLD | NEW |