Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Side by Side Diff: content/browser/frame_host/navigator_impl.cc

Issue 2707263013: Don't recreate feature policy on fragment navigation (Closed)
Patch Set: Simplify test navigation Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/frame_host/navigator_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/browser/frame_host/navigator_impl.h" 5 #include "content/browser/frame_host/navigator_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 // (see https://crbug.com/560511). Instead, the next cross-process navigation 678 // (see https://crbug.com/560511). Instead, the next cross-process navigation
679 // or transfer should decide whether to swap as if the net error had not 679 // or transfer should decide whether to swap as if the net error had not
680 // occurred. 680 // occurred.
681 // TODO(creis): Remove this block and always set the URL once transfers handle 681 // TODO(creis): Remove this block and always set the URL once transfers handle
682 // network errors or PlzNavigate is enabled. See https://crbug.com/588314. 682 // network errors or PlzNavigate is enabled. See https://crbug.com/588314.
683 if (!params.url_is_unreachable) 683 if (!params.url_is_unreachable)
684 render_frame_host->set_last_successful_url(params.url); 684 render_frame_host->set_last_successful_url(params.url);
685 685
686 // After setting the last committed origin, reset the feature policy in the 686 // After setting the last committed origin, reset the feature policy in the
687 // RenderFrameHost to a blank policy based on the parent frame. 687 // RenderFrameHost to a blank policy based on the parent frame.
688 render_frame_host->ResetFeaturePolicy(); 688 if (did_navigate && !is_navigation_within_page)
689 render_frame_host->ResetFeaturePolicy();
689 690
690 // Send notification about committed provisional loads. This notification is 691 // Send notification about committed provisional loads. This notification is
691 // different from the NAV_ENTRY_COMMITTED notification which doesn't include 692 // different from the NAV_ENTRY_COMMITTED notification which doesn't include
692 // the actual URL navigated to and isn't sent for AUTO_SUBFRAME navigations. 693 // the actual URL navigated to and isn't sent for AUTO_SUBFRAME navigations.
693 if (details.type != NAVIGATION_TYPE_NAV_IGNORE && delegate_) { 694 if (details.type != NAVIGATION_TYPE_NAV_IGNORE && delegate_) {
694 DCHECK_EQ(!render_frame_host->GetParent(), 695 DCHECK_EQ(!render_frame_host->GetParent(),
695 did_navigate ? details.is_main_frame : false); 696 did_navigate ? details.is_main_frame : false);
696 navigation_handle->DidCommitNavigation(params, details.did_replace_entry, 697 navigation_handle->DidCommitNavigation(params, details.did_replace_entry,
697 details.previous_url, details.type, 698 details.previous_url, details.type,
698 render_frame_host); 699 render_frame_host);
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
1287 if (navigation_handle) 1288 if (navigation_handle)
1288 navigation_handle->update_entry_id_for_transfer(entry->GetUniqueID()); 1289 navigation_handle->update_entry_id_for_transfer(entry->GetUniqueID());
1289 1290
1290 controller_->SetPendingEntry(std::move(entry)); 1291 controller_->SetPendingEntry(std::move(entry));
1291 if (delegate_) 1292 if (delegate_)
1292 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); 1293 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL);
1293 } 1294 }
1294 } 1295 }
1295 1296
1296 } // namespace content 1297 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/frame_host/navigator_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698