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 <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 const std::string& request_method, | 143 const std::string& request_method, |
144 const base::Callback<void(bool)>& callback) override { | 144 const base::Callback<void(bool)>& callback) override { |
145 prerender_contents_->Destroy(FINAL_STATUS_DOWNLOAD); | 145 prerender_contents_->Destroy(FINAL_STATUS_DOWNLOAD); |
146 // Cancel the download. | 146 // Cancel the download. |
147 callback.Run(false); | 147 callback.Run(false); |
148 } | 148 } |
149 | 149 |
150 bool ShouldCreateWebContents( | 150 bool ShouldCreateWebContents( |
151 WebContents* web_contents, | 151 WebContents* web_contents, |
152 int route_id, | 152 int route_id, |
| 153 int main_frame_route_id, |
153 WindowContainerType window_container_type, | 154 WindowContainerType window_container_type, |
154 const base::string16& frame_name, | 155 const base::string16& frame_name, |
155 const GURL& target_url, | 156 const GURL& target_url, |
156 const std::string& partition_id, | 157 const std::string& partition_id, |
157 SessionStorageNamespace* session_storage_namespace) override { | 158 SessionStorageNamespace* session_storage_namespace) override { |
158 // Since we don't want to permit child windows that would have a | 159 // Since we don't want to permit child windows that would have a |
159 // window.opener property, terminate prerendering. | 160 // window.opener property, terminate prerendering. |
160 prerender_contents_->Destroy(FINAL_STATUS_CREATE_NEW_WINDOW); | 161 prerender_contents_->Destroy(FINAL_STATUS_CREATE_NEW_WINDOW); |
161 // Cancel the popup. | 162 // Cancel the popup. |
162 return false; | 163 return false; |
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
883 void PrerenderContents::AddResourceThrottle( | 884 void PrerenderContents::AddResourceThrottle( |
884 const base::WeakPtr<PrerenderResourceThrottle>& throttle) { | 885 const base::WeakPtr<PrerenderResourceThrottle>& throttle) { |
885 resource_throttles_.push_back(throttle); | 886 resource_throttles_.push_back(throttle); |
886 } | 887 } |
887 | 888 |
888 void PrerenderContents::AddNetworkBytes(int64 bytes) { | 889 void PrerenderContents::AddNetworkBytes(int64 bytes) { |
889 network_bytes_ += bytes; | 890 network_bytes_ += bytes; |
890 } | 891 } |
891 | 892 |
892 } // namespace prerender | 893 } // namespace prerender |
OLD | NEW |