| 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 da20a1ee15fb52f76dc45c63fd26058e4f232110..fcd8f54d05aac080db40a296136cdadbd98a32ca 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/devtools/render_frame_devtools_agent_host.h"
|
| #include "content/browser/frame_host/frame_tree_node.h"
|
| #include "content/browser/frame_host/navigator.h"
|
| @@ -17,6 +19,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"
|
| @@ -31,6 +34,11 @@ void UpdateThrottleCheckResult(
|
| *to_update = result;
|
| }
|
|
|
| +bool AreExperimentalFeaturesEnabled() {
|
| + return base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| + switches::kEnableExperimentalWebPlatformFeatures);
|
| +}
|
| +
|
| } // namespace
|
|
|
| // static
|
| @@ -525,7 +533,7 @@ void NavigationHandleImpl::RunCompleteCallback(
|
| }
|
|
|
| void NavigationHandleImpl::RegisterNavigationThrottles() {
|
| - // Register the navigation throttles. The ScopedVector returned by
|
| + // 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.
|
| @@ -540,6 +548,17 @@ void NavigationHandleImpl::RegisterNavigationThrottles() {
|
| RenderFrameDevToolsAgentHost::CreateThrottleForNavigation(this);
|
| if (devtools_throttle)
|
| throttles_.push_back(devtools_throttle.release());
|
| +
|
| + // Register the platform's navigation throttles.
|
| + if (AreExperimentalFeaturesEnabled()) {
|
| + // TODO(msramek): It is currently not clear whether ClearSiteDataThrottle
|
| + // should defer the navigation until clearing is complete. If we decide
|
| + // that it shouldn't, and crbug.com/621856 is fixed, it should be instead
|
| + // implemented as a WebContentsObserver.
|
| + std::unique_ptr<content::NavigationThrottle> clear_site_data_throttle =
|
| + content::ClearSiteDataThrottle::CreateThrottleFor(this);
|
| + throttles_.push_back(std::move(clear_site_data_throttle));
|
| + }
|
| }
|
|
|
| } // namespace content
|
|
|