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