| 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 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 | 555 |
| 556 void PrerenderContents::DocumentLoadedInFrame( | 556 void PrerenderContents::DocumentLoadedInFrame( |
| 557 content::RenderFrameHost* render_frame_host) { | 557 content::RenderFrameHost* render_frame_host) { |
| 558 if (!render_frame_host->GetParent()) | 558 if (!render_frame_host->GetParent()) |
| 559 NotifyPrerenderDomContentLoaded(); | 559 NotifyPrerenderDomContentLoaded(); |
| 560 } | 560 } |
| 561 | 561 |
| 562 void PrerenderContents::DidStartProvisionalLoadForFrame( | 562 void PrerenderContents::DidStartProvisionalLoadForFrame( |
| 563 content::RenderFrameHost* render_frame_host, | 563 content::RenderFrameHost* render_frame_host, |
| 564 const GURL& validated_url, | 564 const GURL& validated_url, |
| 565 bool is_error_page, | 565 bool is_error_page) { |
| 566 bool is_iframe_srcdoc) { | |
| 567 if (!render_frame_host->GetParent()) { | 566 if (!render_frame_host->GetParent()) { |
| 568 if (!CheckURL(validated_url)) | 567 if (!CheckURL(validated_url)) |
| 569 return; | 568 return; |
| 570 | 569 |
| 571 // Usually, this event fires if the user clicks or enters a new URL. | 570 // Usually, this event fires if the user clicks or enters a new URL. |
| 572 // Neither of these can happen in the case of an invisible prerender. | 571 // Neither of these can happen in the case of an invisible prerender. |
| 573 // So the cause is: Some JavaScript caused a new URL to be loaded. In that | 572 // So the cause is: Some JavaScript caused a new URL to be loaded. In that |
| 574 // case, the spinner would start again in the browser, so we must reset | 573 // case, the spinner would start again in the browser, so we must reset |
| 575 // has_stopped_loading_ so that the spinner won't be stopped. | 574 // has_stopped_loading_ so that the spinner won't be stopped. |
| 576 has_stopped_loading_ = false; | 575 has_stopped_loading_ = false; |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 751 void PrerenderContents::AddResourceThrottle( | 750 void PrerenderContents::AddResourceThrottle( |
| 752 const base::WeakPtr<PrerenderResourceThrottle>& throttle) { | 751 const base::WeakPtr<PrerenderResourceThrottle>& throttle) { |
| 753 resource_throttles_.push_back(throttle); | 752 resource_throttles_.push_back(throttle); |
| 754 } | 753 } |
| 755 | 754 |
| 756 void PrerenderContents::AddNetworkBytes(int64_t bytes) { | 755 void PrerenderContents::AddNetworkBytes(int64_t bytes) { |
| 757 network_bytes_ += bytes; | 756 network_bytes_ += bytes; |
| 758 } | 757 } |
| 759 | 758 |
| 760 } // namespace prerender | 759 } // namespace prerender |
| OLD | NEW |