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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 void CanDownload(const GURL& url, | 133 void CanDownload(const GURL& url, |
134 const std::string& request_method, | 134 const std::string& request_method, |
135 const base::Callback<void(bool)>& callback) override { | 135 const base::Callback<void(bool)>& callback) override { |
136 prerender_contents_->Destroy(FINAL_STATUS_DOWNLOAD); | 136 prerender_contents_->Destroy(FINAL_STATUS_DOWNLOAD); |
137 // Cancel the download. | 137 // Cancel the download. |
138 callback.Run(false); | 138 callback.Run(false); |
139 } | 139 } |
140 | 140 |
141 bool ShouldCreateWebContents( | 141 bool ShouldCreateWebContents( |
142 content::WebContents* web_contents, | 142 content::WebContents* web_contents, |
| 143 content::RenderFrameHost* opener, |
143 content::SiteInstance* source_site_instance, | 144 content::SiteInstance* source_site_instance, |
144 int32_t route_id, | 145 int32_t route_id, |
145 int32_t main_frame_route_id, | 146 int32_t main_frame_route_id, |
146 int32_t main_frame_widget_route_id, | 147 int32_t main_frame_widget_route_id, |
147 content::mojom::WindowContainerType window_container_type, | 148 content::mojom::WindowContainerType window_container_type, |
148 const GURL& opener_url, | 149 const GURL& opener_url, |
149 const std::string& frame_name, | 150 const std::string& frame_name, |
150 const GURL& target_url, | 151 const GURL& target_url, |
151 const std::string& partition_id, | 152 const std::string& partition_id, |
152 SessionStorageNamespace* session_storage_namespace) override { | 153 SessionStorageNamespace* session_storage_namespace) override { |
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
789 idle_resources_.push_back(throttle); | 790 idle_resources_.push_back(throttle); |
790 } | 791 } |
791 | 792 |
792 void PrerenderContents::AddNetworkBytes(int64_t bytes) { | 793 void PrerenderContents::AddNetworkBytes(int64_t bytes) { |
793 network_bytes_ += bytes; | 794 network_bytes_ += bytes; |
794 for (Observer& observer : observer_list_) | 795 for (Observer& observer : observer_list_) |
795 observer.OnPrerenderNetworkBytesChanged(this); | 796 observer.OnPrerenderNetworkBytesChanged(this); |
796 } | 797 } |
797 | 798 |
798 } // namespace prerender | 799 } // namespace prerender |
OLD | NEW |