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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 void CanDownload(const GURL& url, | 108 void CanDownload(const GURL& url, |
109 const std::string& request_method, | 109 const std::string& request_method, |
110 const base::Callback<void(bool)>& callback) override { | 110 const base::Callback<void(bool)>& callback) override { |
111 prerender_contents_->Destroy(FINAL_STATUS_DOWNLOAD); | 111 prerender_contents_->Destroy(FINAL_STATUS_DOWNLOAD); |
112 // Cancel the download. | 112 // Cancel the download. |
113 callback.Run(false); | 113 callback.Run(false); |
114 } | 114 } |
115 | 115 |
116 bool ShouldCreateWebContents( | 116 bool ShouldCreateWebContents( |
117 WebContents* web_contents, | 117 WebContents* web_contents, |
118 int route_id, | 118 int32_t route_id, |
119 int main_frame_route_id, | 119 int32_t main_frame_route_id, |
| 120 int32_t main_frame_widget_route_id, |
120 WindowContainerType window_container_type, | 121 WindowContainerType window_container_type, |
121 const std::string& frame_name, | 122 const std::string& frame_name, |
122 const GURL& target_url, | 123 const GURL& target_url, |
123 const std::string& partition_id, | 124 const std::string& partition_id, |
124 SessionStorageNamespace* session_storage_namespace) override { | 125 SessionStorageNamespace* session_storage_namespace) override { |
125 // Since we don't want to permit child windows that would have a | 126 // Since we don't want to permit child windows that would have a |
126 // window.opener property, terminate prerendering. | 127 // window.opener property, terminate prerendering. |
127 prerender_contents_->Destroy(FINAL_STATUS_CREATE_NEW_WINDOW); | 128 prerender_contents_->Destroy(FINAL_STATUS_CREATE_NEW_WINDOW); |
128 // Cancel the popup. | 129 // Cancel the popup. |
129 return false; | 130 return false; |
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
750 void PrerenderContents::AddResourceThrottle( | 751 void PrerenderContents::AddResourceThrottle( |
751 const base::WeakPtr<PrerenderResourceThrottle>& throttle) { | 752 const base::WeakPtr<PrerenderResourceThrottle>& throttle) { |
752 resource_throttles_.push_back(throttle); | 753 resource_throttles_.push_back(throttle); |
753 } | 754 } |
754 | 755 |
755 void PrerenderContents::AddNetworkBytes(int64 bytes) { | 756 void PrerenderContents::AddNetworkBytes(int64 bytes) { |
756 network_bytes_ += bytes; | 757 network_bytes_ += bytes; |
757 } | 758 } |
758 | 759 |
759 } // namespace prerender | 760 } // namespace prerender |
OLD | NEW |