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 // Example: prerendering a site that redirects to an app URL. |
94 // or if --enable-strict-site-isolation is specified and the prerendered | |
Charlie Reis
2015/06/05 23:06:17
Probably keep this comment and just say --site-per
ncarter (slow)
2015/06/06 18:24:33
Done.
| |
95 // frame redirects to a different origin. | |
96 // TODO(cbentzel): Consider supporting this if it is a common case during | 94 // TODO(cbentzel): Consider supporting this if it is a common case during |
97 // prerenders. | 95 // prerenders. |
98 prerender_contents_->Destroy(FINAL_STATUS_OPEN_URL); | 96 prerender_contents_->Destroy(FINAL_STATUS_OPEN_URL); |
99 return NULL; | 97 return NULL; |
100 } | 98 } |
101 | 99 |
102 void CloseContents(content::WebContents* contents) override { | 100 void CloseContents(content::WebContents* contents) override { |
103 prerender_contents_->Destroy(FINAL_STATUS_CLOSED); | 101 prerender_contents_->Destroy(FINAL_STATUS_CLOSED); |
104 } | 102 } |
105 | 103 |
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
739 void PrerenderContents::AddResourceThrottle( | 737 void PrerenderContents::AddResourceThrottle( |
740 const base::WeakPtr<PrerenderResourceThrottle>& throttle) { | 738 const base::WeakPtr<PrerenderResourceThrottle>& throttle) { |
741 resource_throttles_.push_back(throttle); | 739 resource_throttles_.push_back(throttle); |
742 } | 740 } |
743 | 741 |
744 void PrerenderContents::AddNetworkBytes(int64 bytes) { | 742 void PrerenderContents::AddNetworkBytes(int64 bytes) { |
745 network_bytes_ += bytes; | 743 network_bytes_ += bytes; |
746 } | 744 } |
747 | 745 |
748 } // namespace prerender | 746 } // namespace prerender |
OLD | NEW |