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

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

Issue 2694183004: Adding TabRestore PLM UMA (Closed)
Patch Set: rebase + comments Created 3 years, 10 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"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 navigation_start_(navigation_start), 101 navigation_start_(navigation_start),
102 pending_nav_entry_id_(pending_nav_entry_id), 102 pending_nav_entry_id_(pending_nav_entry_id),
103 request_context_type_(REQUEST_CONTEXT_TYPE_UNSPECIFIED), 103 request_context_type_(REQUEST_CONTEXT_TYPE_UNSPECIFIED),
104 mixed_content_context_type_(blink::WebMixedContentContextType::Blockable), 104 mixed_content_context_type_(blink::WebMixedContentContextType::Blockable),
105 should_replace_current_entry_(false), 105 should_replace_current_entry_(false),
106 redirect_chain_(redirect_chain), 106 redirect_chain_(redirect_chain),
107 is_download_(false), 107 is_download_(false),
108 is_stream_(false), 108 is_stream_(false),
109 started_from_context_menu_(started_from_context_menu), 109 started_from_context_menu_(started_from_context_menu),
110 reload_type_(ReloadType::NONE), 110 reload_type_(ReloadType::NONE),
111 restore_type_(RestoreType::NONE),
111 navigation_type_(NAVIGATION_TYPE_UNKNOWN), 112 navigation_type_(NAVIGATION_TYPE_UNKNOWN),
112 weak_factory_(this) { 113 weak_factory_(this) {
113 DCHECK(!navigation_start.is_null()); 114 DCHECK(!navigation_start.is_null());
114 if (redirect_chain_.empty()) 115 if (redirect_chain_.empty())
115 redirect_chain_.push_back(url); 116 redirect_chain_.push_back(url);
116 117
117 starting_site_instance_ = 118 starting_site_instance_ =
118 frame_tree_node_->current_frame_host()->GetSiteInstance(); 119 frame_tree_node_->current_frame_host()->GetSiteInstance();
119 120
120 if (pending_nav_entry_id_) { 121 if (pending_nav_entry_id_) {
121 NavigationControllerImpl* nav_controller = 122 NavigationControllerImpl* nav_controller =
122 static_cast<NavigationControllerImpl*>( 123 static_cast<NavigationControllerImpl*>(
123 frame_tree_node_->navigator()->GetController()); 124 frame_tree_node_->navigator()->GetController());
124 NavigationEntryImpl* nav_entry = 125 NavigationEntryImpl* nav_entry =
125 nav_controller->GetEntryWithUniqueID(pending_nav_entry_id_); 126 nav_controller->GetEntryWithUniqueID(pending_nav_entry_id_);
126 if (!nav_entry && 127 if (!nav_entry &&
127 nav_controller->GetPendingEntry() && 128 nav_controller->GetPendingEntry() &&
128 nav_controller->GetPendingEntry()->GetUniqueID() == 129 nav_controller->GetPendingEntry()->GetUniqueID() ==
129 pending_nav_entry_id_) { 130 pending_nav_entry_id_) {
130 nav_entry = nav_controller->GetPendingEntry(); 131 nav_entry = nav_controller->GetPendingEntry();
131 } 132 }
132 133
133 if (nav_entry) 134 if (nav_entry) {
134 reload_type_ = nav_entry->reload_type(); 135 reload_type_ = nav_entry->reload_type();
136 restore_type_ = nav_entry->restore_type();
137 }
135 } 138 }
136 139
137 if (!IsRendererDebugURL(url_)) 140 if (!IsRendererDebugURL(url_))
138 GetDelegate()->DidStartNavigation(this); 141 GetDelegate()->DidStartNavigation(this);
139 142
140 if (IsInMainFrame()) { 143 if (IsInMainFrame()) {
141 TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP1( 144 TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP1(
142 "navigation", "Navigation StartToCommit", this, 145 "navigation", "Navigation StartToCommit", this,
143 navigation_start, "Initial URL", url_.spec()); 146 navigation_start, "Initial URL", url_.spec());
144 } 147 }
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 } 448 }
446 449
447 const std::string& NavigationHandleImpl::GetSearchableFormEncoding() { 450 const std::string& NavigationHandleImpl::GetSearchableFormEncoding() {
448 return searchable_form_encoding_; 451 return searchable_form_encoding_;
449 } 452 }
450 453
451 ReloadType NavigationHandleImpl::GetReloadType() { 454 ReloadType NavigationHandleImpl::GetReloadType() {
452 return reload_type_; 455 return reload_type_;
453 } 456 }
454 457
458 RestoreType NavigationHandleImpl::GetRestoreType() {
459 return restore_type_;
460 }
461
455 NavigationData* NavigationHandleImpl::GetNavigationData() { 462 NavigationData* NavigationHandleImpl::GetNavigationData() {
456 return navigation_data_.get(); 463 return navigation_data_.get();
457 } 464 }
458 465
459 const GlobalRequestID& NavigationHandleImpl::GetGlobalRequestID() { 466 const GlobalRequestID& NavigationHandleImpl::GetGlobalRequestID() {
460 DCHECK(state_ == WILL_PROCESS_RESPONSE || state_ == DEFERRING_RESPONSE || 467 DCHECK(state_ == WILL_PROCESS_RESPONSE || state_ == DEFERRING_RESPONSE ||
461 state_ == READY_TO_COMMIT); 468 state_ == READY_TO_COMMIT);
462 return request_id_; 469 return request_id_;
463 } 470 }
464 471
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
929 if (node->current_url().EqualsIgnoringRef(url_)) { 936 if (node->current_url().EqualsIgnoringRef(url_)) {
930 if (found_self_reference) 937 if (found_self_reference)
931 return true; 938 return true;
932 found_self_reference = true; 939 found_self_reference = true;
933 } 940 }
934 } 941 }
935 return false; 942 return false;
936 } 943 }
937 944
938 } // namespace content 945 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/navigation_handle_impl.h ('k') | content/public/browser/navigation_handle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698