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

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

Issue 2638423008: Convert ContentFaviconDriver to use the new navigation callbacks. (Closed)
Patch Set: fix test by only looking at successful commits as before Created 3 years, 11 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 <iterator> 7 #include <iterator>
8 8
9 #include "base/debug/dump_without_crashing.h" 9 #include "base/debug/dump_without_crashing.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "content/browser/appcache/appcache_navigation_handle.h" 11 #include "content/browser/appcache/appcache_navigation_handle.h"
12 #include "content/browser/appcache/appcache_service_impl.h" 12 #include "content/browser/appcache/appcache_service_impl.h"
13 #include "content/browser/browsing_data/clear_site_data_throttle.h" 13 #include "content/browser/browsing_data/clear_site_data_throttle.h"
14 #include "content/browser/child_process_security_policy_impl.h" 14 #include "content/browser/child_process_security_policy_impl.h"
15 #include "content/browser/devtools/render_frame_devtools_agent_host.h" 15 #include "content/browser/devtools/render_frame_devtools_agent_host.h"
16 #include "content/browser/frame_host/ancestor_throttle.h" 16 #include "content/browser/frame_host/ancestor_throttle.h"
17 #include "content/browser/frame_host/debug_urls.h" 17 #include "content/browser/frame_host/debug_urls.h"
18 #include "content/browser/frame_host/frame_tree_node.h" 18 #include "content/browser/frame_host/frame_tree_node.h"
19 #include "content/browser/frame_host/navigation_controller_impl.h"
20 #include "content/browser/frame_host/navigation_entry_impl.h"
19 #include "content/browser/frame_host/navigator.h" 21 #include "content/browser/frame_host/navigator.h"
20 #include "content/browser/frame_host/navigator_delegate.h" 22 #include "content/browser/frame_host/navigator_delegate.h"
21 #include "content/browser/loader/resource_dispatcher_host_impl.h" 23 #include "content/browser/loader/resource_dispatcher_host_impl.h"
22 #include "content/browser/service_worker/service_worker_context_wrapper.h" 24 #include "content/browser/service_worker/service_worker_context_wrapper.h"
23 #include "content/browser/service_worker/service_worker_navigation_handle.h" 25 #include "content/browser/service_worker/service_worker_navigation_handle.h"
24 #include "content/common/frame_messages.h" 26 #include "content/common/frame_messages.h"
25 #include "content/common/resource_request_body_impl.h" 27 #include "content/common/resource_request_body_impl.h"
26 #include "content/common/site_isolation_policy.h" 28 #include "content/common/site_isolation_policy.h"
27 #include "content/public/browser/content_browser_client.h" 29 #include "content/public/browser/content_browser_client.h"
28 #include "content/public/browser/navigation_ui_data.h" 30 #include "content/public/browser/navigation_ui_data.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 frame_tree_node_(frame_tree_node), 95 frame_tree_node_(frame_tree_node),
94 next_index_(0), 96 next_index_(0),
95 navigation_start_(navigation_start), 97 navigation_start_(navigation_start),
96 pending_nav_entry_id_(pending_nav_entry_id), 98 pending_nav_entry_id_(pending_nav_entry_id),
97 request_context_type_(REQUEST_CONTEXT_TYPE_UNSPECIFIED), 99 request_context_type_(REQUEST_CONTEXT_TYPE_UNSPECIFIED),
98 mixed_content_context_type_(blink::WebMixedContentContextType::Blockable), 100 mixed_content_context_type_(blink::WebMixedContentContextType::Blockable),
99 should_replace_current_entry_(false), 101 should_replace_current_entry_(false),
100 is_download_(false), 102 is_download_(false),
101 is_stream_(false), 103 is_stream_(false),
102 started_from_context_menu_(started_from_context_menu), 104 started_from_context_menu_(started_from_context_menu),
105 reload_type_(ReloadType::NONE),
103 weak_factory_(this) { 106 weak_factory_(this) {
104 DCHECK(!navigation_start.is_null()); 107 DCHECK(!navigation_start.is_null());
105 redirect_chain_.push_back(url); 108 redirect_chain_.push_back(url);
106 109
107 starting_site_instance_ = 110 starting_site_instance_ =
108 frame_tree_node_->current_frame_host()->GetSiteInstance(); 111 frame_tree_node_->current_frame_host()->GetSiteInstance();
109 112
113 if (pending_nav_entry_id_) {
114 NavigationControllerImpl* nav_controller =
Charlie Reis 2017/01/23 18:30:08 Hmm. This looks like it will be correct if we fin
jam 2017/01/23 19:03:39 I did find a NavEntry for renderer-initiated reloa
Charlie Reis 2017/01/23 19:53:30 Ah, that's from NavigatorImpl::DidStartMainFrameNa
115 static_cast<NavigationControllerImpl*>(
116 frame_tree_node_->navigator()->GetController());
117 NavigationEntryImpl* nav_entry =
118 nav_controller->GetEntryWithUniqueID(pending_nav_entry_id_);
119 if (!nav_entry &&
120 nav_controller->GetPendingEntry() &&
121 nav_controller->GetPendingEntry()->GetUniqueID() ==
122 pending_nav_entry_id_) {
123 nav_entry = nav_controller->GetPendingEntry();
124 }
125
126 if (nav_entry)
127 reload_type_ = nav_entry->reload_type();
128 }
129
110 if (!IsRendererDebugURL(url_)) 130 if (!IsRendererDebugURL(url_))
111 GetDelegate()->DidStartNavigation(this); 131 GetDelegate()->DidStartNavigation(this);
112 132
113 if (IsInMainFrame()) { 133 if (IsInMainFrame()) {
114 TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP1( 134 TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP1(
115 "navigation", "Navigation StartToCommit", this, 135 "navigation", "Navigation StartToCommit", this,
116 navigation_start, "Initial URL", url_.spec()); 136 navigation_start, "Initial URL", url_.spec());
117 } 137 }
118 } 138 }
119 139
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 } 409 }
390 410
391 const GURL& NavigationHandleImpl::GetSearchableFormURL() { 411 const GURL& NavigationHandleImpl::GetSearchableFormURL() {
392 return searchable_form_url_; 412 return searchable_form_url_;
393 } 413 }
394 414
395 const std::string& NavigationHandleImpl::GetSearchableFormEncoding() { 415 const std::string& NavigationHandleImpl::GetSearchableFormEncoding() {
396 return searchable_form_encoding_; 416 return searchable_form_encoding_;
397 } 417 }
398 418
419 ReloadType NavigationHandleImpl::GetReloadType() {
420 return reload_type_;
421 }
422
399 NavigationData* NavigationHandleImpl::GetNavigationData() { 423 NavigationData* NavigationHandleImpl::GetNavigationData() {
400 return navigation_data_.get(); 424 return navigation_data_.get();
401 } 425 }
402 426
403 const GlobalRequestID& NavigationHandleImpl::GetGlobalRequestID() { 427 const GlobalRequestID& NavigationHandleImpl::GetGlobalRequestID() {
404 DCHECK(state_ == WILL_PROCESS_RESPONSE || state_ == DEFERRING_RESPONSE || 428 DCHECK(state_ == WILL_PROCESS_RESPONSE || state_ == DEFERRING_RESPONSE ||
405 state_ == READY_TO_COMMIT); 429 state_ == READY_TO_COMMIT);
406 return request_id_; 430 return request_id_;
407 } 431 }
408 432
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 content::AncestorThrottle::MaybeCreateThrottleFor(this); 830 content::AncestorThrottle::MaybeCreateThrottleFor(this);
807 if (ancestor_throttle) 831 if (ancestor_throttle)
808 throttles_.push_back(std::move(ancestor_throttle)); 832 throttles_.push_back(std::move(ancestor_throttle));
809 833
810 throttles_.insert(throttles_.begin(), 834 throttles_.insert(throttles_.begin(),
811 std::make_move_iterator(throttles_to_register.begin()), 835 std::make_move_iterator(throttles_to_register.begin()),
812 std::make_move_iterator(throttles_to_register.end())); 836 std::make_move_iterator(throttles_to_register.end()));
813 } 837 }
814 838
815 } // namespace content 839 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698