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

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

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
Index: content/browser/frame_host/navigation_request.h
diff --git a/content/browser/frame_host/navigation_request.h b/content/browser/frame_host/navigation_request.h
index eb5372113741e6ee9bb5e6d2eefd21ef957c76d7..502fc6d7343c9d176791a1237254322766315b50 100644
--- a/content/browser/frame_host/navigation_request.h
+++ b/content/browser/frame_host/navigation_request.h
@@ -27,6 +27,28 @@ struct NavigationRequestInfo;
// the navigation following its refactoring.
class CONTENT_EXPORT NavigationRequest : public NavigationURLLoaderDelegate {
public:
+ // Keeps track of the various stages of a NavigationRequest.
+ enum NavigationState {
+ // Initial state.
+ NOT_STARTED = 0,
+
+ // Waiting for a BeginNavigation IPC from the renderer in a
+ // browser-initiated navigation. If there is no live renderer when the
+ // request is created, this stage is skipped.
+ WAITING_FOR_RENDERER_RESPONSE,
+
+ // The request was sent to the IO thread.
+ STARTED,
+
+ // The response started on the IO thread and is ready to be committed. This
+ // is one of the two final states for the request.
+ RESPONSE_STARTED,
+
+ // The request failed on the IO thread and an error page should be
+ // displayed. This is one of the two final states for the request.
+ FAILED,
+ };
+
NavigationRequest(FrameTreeNode* frame_tree_node,
const CommonNavigationParams& common_params,
const CommitNavigationParams& commit_params);
@@ -45,6 +67,13 @@ class CONTENT_EXPORT NavigationRequest : public NavigationURLLoaderDelegate {
NavigationURLLoader* loader_for_testing() const { return loader_.get(); }
+ NavigationState state() const { return state_; }
+
+ void SetWaitingForRendererResponse() {
+ DCHECK(state_ == NOT_STARTED);
+ state_ = WAITING_FOR_RENDERER_RESPONSE;
+ }
+
private:
// NavigationURLLoaderDelegate implementation.
void OnRequestRedirected(
@@ -64,6 +93,8 @@ class CONTENT_EXPORT NavigationRequest : public NavigationURLLoaderDelegate {
CommonNavigationParams common_params_;
const CommitNavigationParams commit_params_;
+ NavigationState state_;
+
scoped_ptr<NavigationURLLoader> loader_;
DISALLOW_COPY_AND_ASSIGN(NavigationRequest);
« no previous file with comments | « content/browser/frame_host/navigation_controller_impl_unittest.cc ('k') | content/browser/frame_host/navigation_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698