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/browsing_data/clear_site_data_throttle.h" |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 | 432 |
433 method_ = params.method; | 433 method_ = params.method; |
434 has_user_gesture_ = (params.gesture == NavigationGestureUser); | 434 has_user_gesture_ = (params.gesture == NavigationGestureUser); |
435 transition_ = params.transition; | 435 transition_ = params.transition; |
436 render_frame_host_ = render_frame_host; | 436 render_frame_host_ = render_frame_host; |
437 is_same_page_ = same_page; | 437 is_same_page_ = same_page; |
438 | 438 |
439 state_ = net_error_code_ == net::OK ? DID_COMMIT : DID_COMMIT_ERROR_PAGE; | 439 state_ = net_error_code_ == net::OK ? DID_COMMIT : DID_COMMIT_ERROR_PAGE; |
440 } | 440 } |
441 | 441 |
442 void NavigationHandleImpl::UpdateSSLCertId(int new_cert_id) { | |
443 DCHECK(ssl_status_.cert_id) << "Must have set an SSL certificate already."; | |
444 ssl_status_.cert_id = new_cert_id; | |
445 } | |
446 | |
447 NavigationThrottle::ThrottleCheckResult | 442 NavigationThrottle::ThrottleCheckResult |
448 NavigationHandleImpl::CheckWillStartRequest() { | 443 NavigationHandleImpl::CheckWillStartRequest() { |
449 DCHECK(state_ == WILL_SEND_REQUEST || state_ == DEFERRING_START); | 444 DCHECK(state_ == WILL_SEND_REQUEST || state_ == DEFERRING_START); |
450 DCHECK(state_ != WILL_SEND_REQUEST || next_index_ == 0); | 445 DCHECK(state_ != WILL_SEND_REQUEST || next_index_ == 0); |
451 DCHECK(state_ != DEFERRING_START || next_index_ != 0); | 446 DCHECK(state_ != DEFERRING_START || next_index_ != 0); |
452 for (size_t i = next_index_; i < throttles_.size(); ++i) { | 447 for (size_t i = next_index_; i < throttles_.size(); ++i) { |
453 NavigationThrottle::ThrottleCheckResult result = | 448 NavigationThrottle::ThrottleCheckResult result = |
454 throttles_[i]->WillStartRequest(); | 449 throttles_[i]->WillStartRequest(); |
455 switch (result) { | 450 switch (result) { |
456 case NavigationThrottle::PROCEED: | 451 case NavigationThrottle::PROCEED: |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 throttles_to_register.push_back(std::move(clear_site_data_throttle)); | 567 throttles_to_register.push_back(std::move(clear_site_data_throttle)); |
573 | 568 |
574 if (throttles_to_register.size() > 0) { | 569 if (throttles_to_register.size() > 0) { |
575 throttles_.insert(throttles_.begin(), throttles_to_register.begin(), | 570 throttles_.insert(throttles_.begin(), throttles_to_register.begin(), |
576 throttles_to_register.end()); | 571 throttles_to_register.end()); |
577 throttles_to_register.weak_clear(); | 572 throttles_to_register.weak_clear(); |
578 } | 573 } |
579 } | 574 } |
580 | 575 |
581 } // namespace content | 576 } // namespace content |
OLD | NEW |