| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/navigation_handle_impl.h" | 5 #include "content/browser/frame_host/navigation_handle_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "content/browser/browsing_data/clear_site_data_throttle.h" |
| 10 #include "content/browser/devtools/render_frame_devtools_agent_host.h" | 11 #include "content/browser/devtools/render_frame_devtools_agent_host.h" |
| 11 #include "content/browser/frame_host/frame_tree_node.h" | 12 #include "content/browser/frame_host/frame_tree_node.h" |
| 12 #include "content/browser/frame_host/navigator.h" | 13 #include "content/browser/frame_host/navigator.h" |
| 13 #include "content/browser/frame_host/navigator_delegate.h" | 14 #include "content/browser/frame_host/navigator_delegate.h" |
| 14 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 15 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
| 15 #include "content/common/frame_messages.h" | 16 #include "content/common/frame_messages.h" |
| 16 #include "content/common/resource_request_body_impl.h" | 17 #include "content/common/resource_request_body_impl.h" |
| 17 #include "content/public/browser/content_browser_client.h" | 18 #include "content/public/browser/content_browser_client.h" |
| 18 #include "content/public/common/browser_side_navigation_policy.h" | 19 #include "content/public/common/browser_side_navigation_policy.h" |
| 19 #include "content/public/common/content_client.h" | 20 #include "content/public/common/content_client.h" |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 void NavigationHandleImpl::RegisterNavigationThrottles() { | 550 void NavigationHandleImpl::RegisterNavigationThrottles() { |
| 550 // Register the navigation throttles. The ScopedVector returned by | 551 // Register the navigation throttles. The ScopedVector returned by |
| 551 // GetNavigationThrottles is not assigned to throttles_ directly because it | 552 // GetNavigationThrottles is not assigned to throttles_ directly because it |
| 552 // would overwrite any throttle previously added with | 553 // would overwrite any throttle previously added with |
| 553 // RegisterThrottleForTesting. | 554 // RegisterThrottleForTesting. |
| 554 ScopedVector<NavigationThrottle> throttles_to_register = | 555 ScopedVector<NavigationThrottle> throttles_to_register = |
| 555 GetContentClient()->browser()->CreateThrottlesForNavigation(this); | 556 GetContentClient()->browser()->CreateThrottlesForNavigation(this); |
| 556 std::unique_ptr<NavigationThrottle> devtools_throttle = | 557 std::unique_ptr<NavigationThrottle> devtools_throttle = |
| 557 RenderFrameDevToolsAgentHost::CreateThrottleForNavigation(this); | 558 RenderFrameDevToolsAgentHost::CreateThrottleForNavigation(this); |
| 558 if (devtools_throttle) | 559 if (devtools_throttle) |
| 559 throttles_to_register.push_back(devtools_throttle.release()); | 560 throttles_to_register.push_back(std::move(devtools_throttle)); |
| 561 |
| 562 std::unique_ptr<NavigationThrottle> clear_site_data_throttle = |
| 563 ClearSiteDataThrottle::CreateThrottleForNavigation(this); |
| 564 if (clear_site_data_throttle) |
| 565 throttles_to_register.push_back(std::move(clear_site_data_throttle)); |
| 560 | 566 |
| 561 if (throttles_to_register.size() > 0) { | 567 if (throttles_to_register.size() > 0) { |
| 562 throttles_.insert(throttles_.begin(), throttles_to_register.begin(), | 568 throttles_.insert(throttles_.begin(), throttles_to_register.begin(), |
| 563 throttles_to_register.end()); | 569 throttles_to_register.end()); |
| 564 throttles_to_register.weak_clear(); | 570 throttles_to_register.weak_clear(); |
| 565 } | 571 } |
| 566 } | 572 } |
| 567 | 573 |
| 568 } // namespace content | 574 } // namespace content |
| OLD | NEW |