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

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

Issue 483773002: PlzNavigate: implement CommitNavigation on the browser side (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added a class to keep track of navigation parameters Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/frame_host/navigation_parameters.h
diff --git a/content/browser/frame_host/navigation_parameters.h b/content/browser/frame_host/navigation_parameters.h
new file mode 100644
index 0000000000000000000000000000000000000000..91fb610115d9ee6f808c3b7651383a5faa83de74
--- /dev/null
+++ b/content/browser/frame_host/navigation_parameters.h
@@ -0,0 +1,111 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATION_PARAMETERS_H_
+#define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_PARAMETERS_H_
+
+#include <string>
+
+#include "base/basictypes.h"
+#include "base/time/time.h"
+#include "content/common/frame_message_enums.h"
+#include "content/public/common/page_state.h"
+#include "content/public/common/page_transition_types.h"
+#include "content/public/common/referrer.h"
+#include "url/gurl.h"
+struct FrameHostMsg_BeginNavigation_Params;
+struct FrameMsg_CommitNavigation_Params;
+
+namespace content {
+class NavigationControllerImpl;
+class NavigationEntryImpl;
+struct NavigationBeforeCommitInfo;
+
+// PlzNavigate
+// This class holds parameters for a Navigation. It is first created when the
(Do not use) nasko 2014/09/05 17:04:48 nit: "navigation", no need to uppercase.
+// the navigation is requested, then updated when the navigation begins and when
(Do not use) nasko 2014/09/05 17:04:48 In the case of renderer initiated, there will be n
+// the navigation is ready to commit.
+class NavigationParameters {
clamy 2014/09/03 22:23:44 Disclaimer: if you have a great name for that clas
(Do not use) nasko 2014/09/05 17:04:48 I don't have anything greater than what you've alr
+ public:
+ NavigationParameters(const NavigationEntryImpl& entry,
+ NavigationControllerImpl* controller,
+ base::TimeTicks navigation_start,
+ FrameMsg_Navigate_Type::Value navigation_type);
+ ~NavigationParameters();
+
+ bool allow_download() const { return allow_download_; }
+ FrameMsg_Navigate_Type::Value navigation_type_for_testing() const {
+ return navigation_type_;
+ }
+
+ void UpdateFromBeginNavigationParams(
(Do not use) nasko 2014/09/05 17:04:48 nit: I'd drop the "Params" part of the name, it is
+ const FrameHostMsg_BeginNavigation_Params& begin_navigation_params);
+ void UpdateFromCommitInfo(const NavigationBeforeCommitInfo& commit_info);
+
+ // Simulates the response from the renderer when there is no live renderer.
+ FrameHostMsg_BeginNavigation_Params SimulateRendererResponse() const;
(Do not use) nasko 2014/09/05 17:04:48 Is this intended for tests? Or temporary? It shoul
+
+ FrameMsg_CommitNavigation_Params MakeCommitNavigationParams() const;
+
+ private:
+ // The URL to navigate to. May be modified when th enavigation is ready to
(Do not use) nasko 2014/09/05 17:04:48 "the navigation"
+ // commit.
+ GURL url_;
+
+ // The URL to request to the browser to get access to the stream of data.
(Do not use) nasko 2014/09/05 17:04:48 nit: "The URL the renderer should request from the
+ GURL stream_url_;
+
+ bool is_post_;
(Do not use) nasko 2014/09/05 17:04:48 comment?
+
+ // The page_id for this navigation, or -1 if it is a new navigation. Back,
+ // Forward, and Reload navigations should have a valid page_id. If the load
+ // succeeds, then this page_id will be reflected in the resultant
+ // FrameHostMsg_DidCommitProvisionalLoad message.
+ int32 page_id_;
+
+ // Informs the RenderView the session history should be cleared. In that
(Do not use) nasko 2014/09/05 17:04:48 nit: Let's start using RenderFrame in all new code
+ // case, the RenderView needs to notify the browser that the clearing was
+ // succesful when the navigation commits.
+ bool should_clear_history_list_;
+
+ // If page_id is -1, then pending_history_list_offset will also be -1.
+ // Otherwise, it contains the offset into the history list corresponding to
+ // the current navigation.
+ int pending_history_list_offset_;
+
+ // Used to inform the RenderView of where its current page contents reside in
+ // session history and the total size of the session history list.
+ int current_history_list_offset_;
+ int current_history_list_length_;
+
+ // The URL to send in the "Referer" header field. Can be empty if there is
+ // no referrer.
+ Referrer referrer_;
+
+ // The type of transition.
+ PageTransition transition_;
+
+ // Opaque history state (received by ViewHostMsg_UpdateState).
+ PageState page_state_;
+
+ // Type of navigation.
+ FrameMsg_Navigate_Type::Value navigation_type_;
+
+ // Whether or not the user agent override string should be used.
+ bool is_overriding_user_agent_;
+
+ // Whether this navigation should replace the current session history entry on
+ // commit.
+ bool should_replace_current_entry_;
+
+ // Whether or not we should allow the URL to download.
+ bool allow_download_;
+
+ // The navigationStart time to expose through the Navigation Timing API to JS.
+ base::TimeTicks browser_navigation_start_;
(Do not use) nasko 2014/09/05 17:04:48 This is mostly a copy of FrameMsg_Navigate_Params.
clamy 2014/09/05 18:21:25 So if we split up the IPCs in having some sort of
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_PARAMETERS_H_

Powered by Google App Engine
This is Rietveld 408576698