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

Unified Diff: content/browser/frame_host/navigation_handle_impl.cc

Issue 2132673002: Adding Navigation Throttles to DevTools (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove print Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/frame_host/navigation_handle_impl.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..da20a1ee15fb52f76dc45c63fd26058e4f232110 100644
--- a/content/browser/frame_host/navigation_handle_impl.cc
+++ b/content/browser/frame_host/navigation_handle_impl.cc
@@ -7,6 +7,7 @@
#include <utility>
#include "base/logging.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"
#include "content/browser/frame_host/navigator_delegate.h"
@@ -323,17 +324,7 @@ void NavigationHandleImpl::WillStartRequest(
state_ = WILL_SEND_REQUEST;
complete_callback_ = callback;
- // Register the navigation throttles. The ScopedVector returned by
- // GetNavigationThrottles is not assigned to throttles_ directly because it
- // would overwrite any throttle previously added with
- // RegisterThrottleForTesting.
- ScopedVector<NavigationThrottle> throttles_to_register =
- GetContentClient()->browser()->CreateThrottlesForNavigation(this);
- if (throttles_to_register.size() > 0) {
- throttles_.insert(throttles_.end(), throttles_to_register.begin(),
- throttles_to_register.end());
- throttles_to_register.weak_clear();
- }
+ RegisterNavigationThrottles();
// Notify each throttle of the request.
NavigationThrottle::ThrottleCheckResult result = CheckWillStartRequest();
@@ -533,4 +524,22 @@ void NavigationHandleImpl::RunCompleteCallback(
// destruction.
}
+void NavigationHandleImpl::RegisterNavigationThrottles() {
+ // Register the navigation throttles. The ScopedVector returned by
+ // GetNavigationThrottles is not assigned to throttles_ directly because it
+ // would overwrite any throttle previously added with
+ // RegisterThrottleForTesting.
+ ScopedVector<NavigationThrottle> throttles_to_register =
+ GetContentClient()->browser()->CreateThrottlesForNavigation(this);
+ if (throttles_to_register.size() > 0) {
+ throttles_.insert(throttles_.end(), throttles_to_register.begin(),
+ throttles_to_register.end());
+ throttles_to_register.weak_clear();
+ }
+ std::unique_ptr<NavigationThrottle> devtools_throttle =
+ RenderFrameDevToolsAgentHost::CreateThrottleForNavigation(this);
+ if (devtools_throttle)
+ throttles_.push_back(devtools_throttle.release());
+}
+
} // namespace content
« no previous file with comments | « content/browser/frame_host/navigation_handle_impl.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698