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