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 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
677 } | 677 } |
678 } | 678 } |
679 | 679 |
680 void PrerenderContents::DidGetRedirectForResourceRequest( | 680 void PrerenderContents::DidGetRedirectForResourceRequest( |
681 RenderViewHost* render_view_host, | 681 RenderViewHost* render_view_host, |
682 const content::ResourceRedirectDetails& details) { | 682 const content::ResourceRedirectDetails& details) { |
683 // DidGetRedirectForResourceRequest can come for any resource on a page. If | 683 // DidGetRedirectForResourceRequest can come for any resource on a page. If |
684 // it's a redirect on the top-level resource, the name needs to be remembered | 684 // it's a redirect on the top-level resource, the name needs to be remembered |
685 // for future matching, and if it redirects to an https resource, it needs to | 685 // for future matching, and if it redirects to an https resource, it needs to |
686 // be canceled. If a subresource is redirected, nothing changes. | 686 // be canceled. If a subresource is redirected, nothing changes. |
687 if (details.resource_type != ResourceType::MAIN_FRAME) | 687 if (details.resource_type != content::RESOURCE_TYPE_MAIN_FRAME) |
688 return; | 688 return; |
689 CheckURL(details.new_url); | 689 CheckURL(details.new_url); |
690 } | 690 } |
691 | 691 |
692 void PrerenderContents::Destroy(FinalStatus final_status) { | 692 void PrerenderContents::Destroy(FinalStatus final_status) { |
693 DCHECK_NE(final_status, FINAL_STATUS_USED); | 693 DCHECK_NE(final_status, FINAL_STATUS_USED); |
694 | 694 |
695 if (prerendering_has_been_cancelled_) | 695 if (prerendering_has_been_cancelled_) |
696 return; | 696 return; |
697 | 697 |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
886 void PrerenderContents::AddResourceThrottle( | 886 void PrerenderContents::AddResourceThrottle( |
887 const base::WeakPtr<PrerenderResourceThrottle>& throttle) { | 887 const base::WeakPtr<PrerenderResourceThrottle>& throttle) { |
888 resource_throttles_.push_back(throttle); | 888 resource_throttles_.push_back(throttle); |
889 } | 889 } |
890 | 890 |
891 void PrerenderContents::AddNetworkBytes(int64 bytes) { | 891 void PrerenderContents::AddNetworkBytes(int64 bytes) { |
892 network_bytes_ += bytes; | 892 network_bytes_ += bytes; |
893 } | 893 } |
894 | 894 |
895 } // namespace prerender | 895 } // namespace prerender |
OLD | NEW |