Index: content/browser/frame_host/navigation_handle_impl.cc |
diff --git a/content/browser/frame_host/navigation_handle_impl.cc b/content/browser/frame_host/navigation_handle_impl.cc |
index d7dcbefabbf2f06121040f756c61a2c45587d524..98b1cb54858b0322fe63814f20417e352e59a713 100644 |
--- a/content/browser/frame_host/navigation_handle_impl.cc |
+++ b/content/browser/frame_host/navigation_handle_impl.cc |
@@ -6,7 +6,9 @@ |
#include <utility> |
+#include "base/command_line.h" |
#include "base/logging.h" |
+#include "content/browser/browsing_data/clear_site_data_throttle.h" |
#include "content/browser/frame_host/frame_tree_node.h" |
#include "content/browser/frame_host/navigator.h" |
#include "content/browser/frame_host/navigator_delegate.h" |
@@ -16,6 +18,7 @@ |
#include "content/public/browser/content_browser_client.h" |
#include "content/public/common/browser_side_navigation_policy.h" |
#include "content/public/common/content_client.h" |
+#include "content/public/common/content_switches.h" |
#include "net/url_request/redirect_info.h" |
#include "url/gurl.h" |
#include "url/url_constants.h" |
@@ -30,6 +33,11 @@ void UpdateThrottleCheckResult( |
*to_update = result; |
} |
+bool AreExperimentalFeaturesEnabled() { |
+ return base::CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kEnableExperimentalWebPlatformFeatures); |
+} |
+ |
} // namespace |
// static |
@@ -323,7 +331,14 @@ void NavigationHandleImpl::WillStartRequest( |
state_ = WILL_SEND_REQUEST; |
complete_callback_ = callback; |
- // Register the navigation throttles. The ScopedVector returned by |
+ // Register the platform's navigation throttles. |
+ if (AreExperimentalFeaturesEnabled()) { |
+ std::unique_ptr<content::NavigationThrottle> clear_site_data_throttle = |
+ content::ClearSiteDataThrottle::CreateThrottleFor(this); |
+ throttles_.push_back(std::move(clear_site_data_throttle)); |
+ } |
+ |
+ // Register the embedder's navigation throttles. The ScopedVector returned by |
// GetNavigationThrottles is not assigned to throttles_ directly because it |
// would overwrite any throttle previously added with |
// RegisterThrottleForTesting. |