| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/prerender/prerender_contents.h" | 5 #include "chrome/browser/prerender/prerender_contents.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <functional> | 10 #include <functional> |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 124 |
| 125 void CanDownload(const GURL& url, | 125 void CanDownload(const GURL& url, |
| 126 const std::string& request_method, | 126 const std::string& request_method, |
| 127 const base::Callback<void(bool)>& callback) override { | 127 const base::Callback<void(bool)>& callback) override { |
| 128 prerender_contents_->Destroy(FINAL_STATUS_DOWNLOAD); | 128 prerender_contents_->Destroy(FINAL_STATUS_DOWNLOAD); |
| 129 // Cancel the download. | 129 // Cancel the download. |
| 130 callback.Run(false); | 130 callback.Run(false); |
| 131 } | 131 } |
| 132 | 132 |
| 133 bool ShouldCreateWebContents( | 133 bool ShouldCreateWebContents( |
| 134 WebContents* web_contents, | 134 content::WebContents* web_contents, |
| 135 content::SiteInstance* source_site_instance, |
| 135 int32_t route_id, | 136 int32_t route_id, |
| 136 int32_t main_frame_route_id, | 137 int32_t main_frame_route_id, |
| 137 int32_t main_frame_widget_route_id, | 138 int32_t main_frame_widget_route_id, |
| 138 WindowContainerType window_container_type, | 139 WindowContainerType window_container_type, |
| 140 const GURL& opener_url, |
| 139 const std::string& frame_name, | 141 const std::string& frame_name, |
| 140 const GURL& target_url, | 142 const GURL& target_url, |
| 141 const std::string& partition_id, | 143 const std::string& partition_id, |
| 142 SessionStorageNamespace* session_storage_namespace) override { | 144 SessionStorageNamespace* session_storage_namespace) override { |
| 143 // Since we don't want to permit child windows that would have a | 145 // Since we don't want to permit child windows that would have a |
| 144 // window.opener property, terminate prerendering. | 146 // window.opener property, terminate prerendering. |
| 145 prerender_contents_->Destroy(FINAL_STATUS_CREATE_NEW_WINDOW); | 147 prerender_contents_->Destroy(FINAL_STATUS_CREATE_NEW_WINDOW); |
| 146 // Cancel the popup. | 148 // Cancel the popup. |
| 147 return false; | 149 return false; |
| 148 } | 150 } |
| (...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 751 void PrerenderContents::AddResourceThrottle( | 753 void PrerenderContents::AddResourceThrottle( |
| 752 const base::WeakPtr<PrerenderResourceThrottle>& throttle) { | 754 const base::WeakPtr<PrerenderResourceThrottle>& throttle) { |
| 753 resource_throttles_.push_back(throttle); | 755 resource_throttles_.push_back(throttle); |
| 754 } | 756 } |
| 755 | 757 |
| 756 void PrerenderContents::AddNetworkBytes(int64_t bytes) { | 758 void PrerenderContents::AddNetworkBytes(int64_t bytes) { |
| 757 network_bytes_ += bytes; | 759 network_bytes_ += bytes; |
| 758 } | 760 } |
| 759 | 761 |
| 760 } // namespace prerender | 762 } // namespace prerender |
| OLD | NEW |