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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 public: | 83 public: |
84 explicit WebContentsDelegateImpl(PrerenderContents* prerender_contents) | 84 explicit WebContentsDelegateImpl(PrerenderContents* prerender_contents) |
85 : prerender_contents_(prerender_contents) { | 85 : prerender_contents_(prerender_contents) { |
86 } | 86 } |
87 | 87 |
88 // content::WebContentsDelegate implementation: | 88 // content::WebContentsDelegate implementation: |
89 WebContents* OpenURLFromTab(WebContents* source, | 89 WebContents* OpenURLFromTab(WebContents* source, |
90 const OpenURLParams& params) override { | 90 const OpenURLParams& params) override { |
91 // |OpenURLFromTab| is typically called when a frame performs a navigation | 91 // |OpenURLFromTab| is typically called when a frame performs a navigation |
92 // that requires the browser to perform the transition instead of WebKit. | 92 // that requires the browser to perform the transition instead of WebKit. |
93 // Examples include prerendering a site that redirects to an app URL, | 93 // Examples include prerendering a site that redirects to an app URL, or if |
94 // or if --enable-strict-site-isolation is specified and the prerendered | 94 // --site-per-process is specified and the prerendered frame redirects to a |
95 // frame redirects to a different origin. | 95 // different origin. |
96 // TODO(cbentzel): Consider supporting this if it is a common case during | 96 // TODO(cbentzel): Consider supporting this for CURRENT_TAB dispositions, if |
97 // prerenders. | 97 // it is a common case during prerenders. |
98 prerender_contents_->Destroy(FINAL_STATUS_OPEN_URL); | 98 prerender_contents_->Destroy(FINAL_STATUS_OPEN_URL); |
99 return NULL; | 99 return NULL; |
100 } | 100 } |
101 | 101 |
102 void CloseContents(content::WebContents* contents) override { | 102 void CloseContents(content::WebContents* contents) override { |
103 prerender_contents_->Destroy(FINAL_STATUS_CLOSED); | 103 prerender_contents_->Destroy(FINAL_STATUS_CLOSED); |
104 } | 104 } |
105 | 105 |
106 void CanDownload(const GURL& url, | 106 void CanDownload(const GURL& url, |
107 const std::string& request_method, | 107 const std::string& request_method, |
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 void PrerenderContents::AddResourceThrottle( | 739 void PrerenderContents::AddResourceThrottle( |
740 const base::WeakPtr<PrerenderResourceThrottle>& throttle) { | 740 const base::WeakPtr<PrerenderResourceThrottle>& throttle) { |
741 resource_throttles_.push_back(throttle); | 741 resource_throttles_.push_back(throttle); |
742 } | 742 } |
743 | 743 |
744 void PrerenderContents::AddNetworkBytes(int64 bytes) { | 744 void PrerenderContents::AddNetworkBytes(int64 bytes) { |
745 network_bytes_ += bytes; | 745 network_bytes_ += bytes; |
746 } | 746 } |
747 | 747 |
748 } // namespace prerender | 748 } // namespace prerender |
OLD | NEW |