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

Unified Diff: content/browser/frame_host/navigation_request.cc

Issue 761013003: PlzNavigate: add support in several navigation controller unit tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Nasko's comments Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/frame_host/navigation_request.h ('k') | content/browser/frame_host/navigator_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigation_request.cc
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc
index 57f5479727c1c55f65e29f88a442875a0aa623f8..5bc27d4fc9f16b76321cd95e788985122a94b283 100644
--- a/content/browser/frame_host/navigation_request.cc
+++ b/content/browser/frame_host/navigation_request.cc
@@ -21,7 +21,8 @@ NavigationRequest::NavigationRequest(
const CommitNavigationParams& commit_params)
: frame_tree_node_(frame_tree_node),
common_params_(common_params),
- commit_params_(commit_params) {
+ commit_params_(commit_params),
+ state_(NOT_STARTED) {
}
NavigationRequest::~NavigationRequest() {
@@ -31,6 +32,8 @@ void NavigationRequest::BeginNavigation(
scoped_ptr<NavigationRequestInfo> info,
scoped_refptr<ResourceRequestBody> request_body) {
DCHECK(!loader_);
+ DCHECK(state_ == NOT_STARTED || state_ == WAITING_FOR_RENDERER_RESPONSE);
+ state_ = STARTED;
loader_ = NavigationURLLoader::Create(
frame_tree_node_->navigator()->GetController()->GetBrowserContext(),
frame_tree_node_->frame_tree_node_id(), common_params_, info.Pass(),
@@ -55,11 +58,15 @@ void NavigationRequest::OnRequestRedirected(
void NavigationRequest::OnResponseStarted(
const scoped_refptr<ResourceResponse>& response,
scoped_ptr<StreamHandle> body) {
+ DCHECK(state_ == STARTED);
+ state_ = RESPONSE_STARTED;
frame_tree_node_->navigator()->CommitNavigation(frame_tree_node_,
response.get(), body.Pass());
}
void NavigationRequest::OnRequestFailed(int net_error) {
+ DCHECK(state_ == STARTED);
+ state_ = FAILED;
// TODO(davidben): Network failures should display a network error page.
NOTIMPLEMENTED();
}
« no previous file with comments | « content/browser/frame_host/navigation_request.h ('k') | content/browser/frame_host/navigator_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698