Chromium Code Reviews| 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 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 570 void PrerenderContents::DidFinishLoad( | 570 void PrerenderContents::DidFinishLoad( |
| 571 content::RenderFrameHost* render_frame_host, | 571 content::RenderFrameHost* render_frame_host, |
| 572 const GURL& validated_url) { | 572 const GURL& validated_url) { |
| 573 if (!render_frame_host->GetParent()) | 573 if (!render_frame_host->GetParent()) |
| 574 has_finished_loading_ = true; | 574 has_finished_loading_ = true; |
| 575 } | 575 } |
| 576 | 576 |
| 577 void PrerenderContents::DidNavigateMainFrame( | 577 void PrerenderContents::DidNavigateMainFrame( |
| 578 const content::LoadCommittedDetails& details, | 578 const content::LoadCommittedDetails& details, |
| 579 const content::FrameNavigateParams& params) { | 579 const content::FrameNavigateParams& params) { |
| 580 // Offline requests are not subject to navigation and use of history. | |
| 581 if (origin() != ORIGIN_OFFLINE) | |
|
pasko
2017/01/25 12:20:54
s/!=/==/
in case you wondered why a few tests fai
dougarnett
2017/01/25 20:39:33
:-)
| |
| 582 return; | |
| 583 | |
| 580 // If the prerender made a second navigation entry, abort the prerender. This | 584 // If the prerender made a second navigation entry, abort the prerender. This |
| 581 // avoids having to correctly implement a complex history merging case (this | 585 // avoids having to correctly implement a complex history merging case (this |
| 582 // interacts with location.replace) and correctly synchronize with the | 586 // interacts with location.replace) and correctly synchronize with the |
| 583 // renderer. The final status may be monitored to see we need to revisit this | 587 // renderer. The final status may be monitored to see we need to revisit this |
| 584 // decision. This does not affect client redirects as those do not push new | 588 // decision. This does not affect client redirects as those do not push new |
| 585 // history entries. (Calls to location.replace, navigations before onload, and | 589 // history entries. (Calls to location.replace, navigations before onload, and |
| 586 // <meta http-equiv=refresh> with timeouts under 1 second do not create | 590 // <meta http-equiv=refresh> with timeouts under 1 second do not create |
| 587 // entries in Blink.) | 591 // entries in Blink.) |
| 588 if (prerender_contents_->GetController().GetEntryCount() > 1) { | 592 if (prerender_contents_->GetController().GetEntryCount() > 1) { |
| 589 Destroy(FINAL_STATUS_NEW_NAVIGATION_ENTRY); | 593 Destroy(FINAL_STATUS_NEW_NAVIGATION_ENTRY); |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 746 void PrerenderContents::AddResourceThrottle( | 750 void PrerenderContents::AddResourceThrottle( |
| 747 const base::WeakPtr<PrerenderResourceThrottle>& throttle) { | 751 const base::WeakPtr<PrerenderResourceThrottle>& throttle) { |
| 748 resource_throttles_.push_back(throttle); | 752 resource_throttles_.push_back(throttle); |
| 749 } | 753 } |
| 750 | 754 |
| 751 void PrerenderContents::AddNetworkBytes(int64_t bytes) { | 755 void PrerenderContents::AddNetworkBytes(int64_t bytes) { |
| 752 network_bytes_ += bytes; | 756 network_bytes_ += bytes; |
| 753 } | 757 } |
| 754 | 758 |
| 755 } // namespace prerender | 759 } // namespace prerender |
| OLD | NEW |