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

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

Issue 2335133003: PlzNavigate: support the WebRequest API (Closed)
Patch Set: Rebase + addressed nit Created 4 years, 2 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
OLDNEW
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/browsing_data/clear_site_data_throttle.h"
11 #include "content/browser/child_process_security_policy_impl.h" 11 #include "content/browser/child_process_security_policy_impl.h"
12 #include "content/browser/devtools/render_frame_devtools_agent_host.h" 12 #include "content/browser/devtools/render_frame_devtools_agent_host.h"
13 #include "content/browser/frame_host/frame_tree_node.h" 13 #include "content/browser/frame_host/frame_tree_node.h"
14 #include "content/browser/frame_host/navigator.h" 14 #include "content/browser/frame_host/navigator.h"
15 #include "content/browser/frame_host/navigator_delegate.h" 15 #include "content/browser/frame_host/navigator_delegate.h"
16 #include "content/browser/service_worker/service_worker_context_wrapper.h" 16 #include "content/browser/service_worker/service_worker_context_wrapper.h"
17 #include "content/browser/service_worker/service_worker_navigation_handle.h" 17 #include "content/browser/service_worker/service_worker_navigation_handle.h"
18 #include "content/common/frame_messages.h" 18 #include "content/common/frame_messages.h"
19 #include "content/common/resource_request_body_impl.h" 19 #include "content/common/resource_request_body_impl.h"
20 #include "content/common/site_isolation_policy.h" 20 #include "content/common/site_isolation_policy.h"
21 #include "content/public/browser/content_browser_client.h" 21 #include "content/public/browser/content_browser_client.h"
22 #include "content/public/browser/navigation_ui_data.h"
22 #include "content/public/browser/site_instance.h" 23 #include "content/public/browser/site_instance.h"
23 #include "content/public/common/browser_side_navigation_policy.h" 24 #include "content/public/common/browser_side_navigation_policy.h"
24 #include "content/public/common/content_client.h" 25 #include "content/public/common/content_client.h"
25 #include "content/public/common/url_constants.h" 26 #include "content/public/common/url_constants.h"
26 #include "net/url_request/redirect_info.h" 27 #include "net/url_request/redirect_info.h"
27 #include "url/gurl.h" 28 #include "url/gurl.h"
28 #include "url/url_constants.h" 29 #include "url/url_constants.h"
29 30
30 namespace content { 31 namespace content {
31 32
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 sanitized_referrer_ = sanitized_referrer; 391 sanitized_referrer_ = sanitized_referrer;
391 has_user_gesture_ = has_user_gesture; 392 has_user_gesture_ = has_user_gesture;
392 transition_ = transition; 393 transition_ = transition;
393 is_external_protocol_ = is_external_protocol; 394 is_external_protocol_ = is_external_protocol;
394 request_context_type_ = request_context_type; 395 request_context_type_ = request_context_type;
395 state_ = WILL_SEND_REQUEST; 396 state_ = WILL_SEND_REQUEST;
396 complete_callback_ = callback; 397 complete_callback_ = callback;
397 398
398 RegisterNavigationThrottles(); 399 RegisterNavigationThrottles();
399 400
401 if (IsBrowserSideNavigationEnabled())
402 navigation_ui_data_ = GetDelegate()->GetNavigationUIData(this);
403
400 // Notify each throttle of the request. 404 // Notify each throttle of the request.
401 NavigationThrottle::ThrottleCheckResult result = CheckWillStartRequest(); 405 NavigationThrottle::ThrottleCheckResult result = CheckWillStartRequest();
402 406
403 // If the navigation is not deferred, run the callback. 407 // If the navigation is not deferred, run the callback.
404 if (result != NavigationThrottle::DEFER) 408 if (result != NavigationThrottle::DEFER)
405 RunCompleteCallback(result); 409 RunCompleteCallback(result);
406 } 410 }
407 411
408 void NavigationHandleImpl::WillRedirectRequest( 412 void NavigationHandleImpl::WillRedirectRequest(
409 const GURL& new_url, 413 const GURL& new_url,
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 throttles_to_register.push_back(std::move(clear_site_data_throttle)); 727 throttles_to_register.push_back(std::move(clear_site_data_throttle));
724 728
725 if (throttles_to_register.size() > 0) { 729 if (throttles_to_register.size() > 0) {
726 throttles_.insert(throttles_.begin(), throttles_to_register.begin(), 730 throttles_.insert(throttles_.begin(), throttles_to_register.begin(),
727 throttles_to_register.end()); 731 throttles_to_register.end());
728 throttles_to_register.weak_clear(); 732 throttles_to_register.weak_clear();
729 } 733 }
730 } 734 }
731 735
732 } // namespace content 736 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/navigation_handle_impl.h ('k') | content/browser/frame_host/navigation_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698