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

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

Issue 2335133003: PlzNavigate: support the WebRequest API (Closed)
Patch Set: Addressed comments + changes to NavigationHandleImpl following 2364943002 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/devtools/render_frame_devtools_agent_host.h" 11 #include "content/browser/devtools/render_frame_devtools_agent_host.h"
12 #include "content/browser/frame_host/frame_tree_node.h" 12 #include "content/browser/frame_host/frame_tree_node.h"
13 #include "content/browser/frame_host/navigator.h" 13 #include "content/browser/frame_host/navigator.h"
14 #include "content/browser/frame_host/navigator_delegate.h" 14 #include "content/browser/frame_host/navigator_delegate.h"
15 #include "content/browser/service_worker/service_worker_context_wrapper.h" 15 #include "content/browser/service_worker/service_worker_context_wrapper.h"
16 #include "content/browser/service_worker/service_worker_navigation_handle.h" 16 #include "content/browser/service_worker/service_worker_navigation_handle.h"
17 #include "content/common/frame_messages.h" 17 #include "content/common/frame_messages.h"
18 #include "content/common/resource_request_body_impl.h" 18 #include "content/common/resource_request_body_impl.h"
19 #include "content/public/browser/content_browser_client.h" 19 #include "content/public/browser/content_browser_client.h"
20 #include "content/public/browser/navigation_ui_data.h"
20 #include "content/public/common/browser_side_navigation_policy.h" 21 #include "content/public/common/browser_side_navigation_policy.h"
21 #include "content/public/common/content_client.h" 22 #include "content/public/common/content_client.h"
22 #include "content/public/common/url_constants.h" 23 #include "content/public/common/url_constants.h"
23 #include "net/url_request/redirect_info.h" 24 #include "net/url_request/redirect_info.h"
24 #include "url/gurl.h" 25 #include "url/gurl.h"
25 #include "url/url_constants.h" 26 #include "url/url_constants.h"
26 27
27 namespace content { 28 namespace content {
28 29
29 namespace { 30 namespace {
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 sanitized_referrer_ = sanitized_referrer; 377 sanitized_referrer_ = sanitized_referrer;
377 has_user_gesture_ = has_user_gesture; 378 has_user_gesture_ = has_user_gesture;
378 transition_ = transition; 379 transition_ = transition;
379 is_external_protocol_ = is_external_protocol; 380 is_external_protocol_ = is_external_protocol;
380 request_context_type_ = request_context_type; 381 request_context_type_ = request_context_type;
381 state_ = WILL_SEND_REQUEST; 382 state_ = WILL_SEND_REQUEST;
382 complete_callback_ = callback; 383 complete_callback_ = callback;
383 384
384 RegisterNavigationThrottles(); 385 RegisterNavigationThrottles();
385 386
387 if (IsBrowserSideNavigationEnabled()) {
nasko 2016/09/28 17:28:31 nit: No need for {}.
clamy 2016/09/29 15:56:21 Done.
388 navigation_ui_data_ = GetDelegate()->GetNavigationUIData(this);
389 }
390
386 // Notify each throttle of the request. 391 // Notify each throttle of the request.
387 NavigationThrottle::ThrottleCheckResult result = CheckWillStartRequest(); 392 NavigationThrottle::ThrottleCheckResult result = CheckWillStartRequest();
388 393
389 // If the navigation is not deferred, run the callback. 394 // If the navigation is not deferred, run the callback.
390 if (result != NavigationThrottle::DEFER) 395 if (result != NavigationThrottle::DEFER)
391 RunCompleteCallback(result); 396 RunCompleteCallback(result);
392 } 397 }
393 398
394 void NavigationHandleImpl::WillRedirectRequest( 399 void NavigationHandleImpl::WillRedirectRequest(
395 const GURL& new_url, 400 const GURL& new_url,
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 throttles_to_register.push_back(std::move(clear_site_data_throttle)); 613 throttles_to_register.push_back(std::move(clear_site_data_throttle));
609 614
610 if (throttles_to_register.size() > 0) { 615 if (throttles_to_register.size() > 0) {
611 throttles_.insert(throttles_.begin(), throttles_to_register.begin(), 616 throttles_.insert(throttles_.begin(), throttles_to_register.begin(),
612 throttles_to_register.end()); 617 throttles_to_register.end());
613 throttles_to_register.weak_clear(); 618 throttles_to_register.weak_clear();
614 } 619 }
615 } 620 }
616 621
617 } // namespace content 622 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698