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

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..ff1614f27ab8c32bfab51d79bc52100714a8f1cc 100644
--- a/content/browser/frame_host/navigation_request.h
+++ b/content/browser/frame_host/navigation_request.h
@@ -27,6 +27,27 @@ 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. If there is no live
+ // renderer when the request is created, this stage is skipped.
nasko 2014/12/17 19:55:38 The no live renderer is only for browser-initiated
clamy 2014/12/18 13:54:42 This stage only happens in browser initiated navig
+ 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 +66,12 @@ class CONTENT_EXPORT NavigationRequest : public NavigationURLLoaderDelegate {
NavigationURLLoader* loader_for_testing() const { return loader_.get(); }
+ NavigationState state() const { return state_; }
+
+ void SetWaitingForRendererResponse() {
+ state_ = WAITING_FOR_RENDERER_RESPONSE;
nasko 2014/12/17 19:55:38 nit: DCHECK we aren't already in this state?
clamy 2014/12/18 13:54:42 In fact it is even DCHECK that the state is NOT_ST
+ }
+
private:
// NavigationURLLoaderDelegate implementation.
void OnRequestRedirected(
@@ -64,6 +91,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);

Powered by Google App Engine
This is Rietveld 408576698