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