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

Unified Diff: content/common/frame_message_enums.h

Issue 2584513003: PlzNavigate: identify same-page browser-initiated navigation. (Closed)
Patch Set: Allow renderer-initiated reloads. Created 3 years, 11 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/common/frame_message_enums.h
diff --git a/content/common/frame_message_enums.h b/content/common/frame_message_enums.h
index 3d9f84a510f2fcdb3c775c06d1fed12c1f428cdd..42673c3785bea4743ab636f8f052f3a1b7609890 100644
--- a/content/common/frame_message_enums.h
+++ b/content/common/frame_message_enums.h
@@ -29,12 +29,40 @@ struct FrameMsg_Navigate_Type {
// Like RESTORE, except that the navigation contains POST data.
RESTORE_WITH_POST,
- // Navigation type not categorized by the other types.
- NORMAL,
+ // History navigation inside the same document.
+ HISTORY_SAME_DOCUMENT,
+
+ // History navigation to a different document.
+ HISTORY_DIFFERENT_DOCUMENT,
+
+ // Navigation inside the same document. It occurs when the part of the url
+ // that is modified is after the '#' part.
+ SAME_DOCUMENT,
+
+ // Navigation to another document.
+ DIFFERENT_DOCUMENT,
+
+ // Used as a default value. Can be used to assert that the navigation
+ // classification has been done.
+ UNSPECIFIED,
nasko 2017/01/23 19:10:13 Can we avoid having such value? We should know the
arthursonzogni 2017/01/24 15:17:04 It is used in the default constructor of CommonNav
nasko 2017/01/24 16:59:35 Using DIFFERENT_DOCUMENT sgtm, since it is the mos
// Last guard value, so we can use it for validity checks.
- NAVIGATE_TYPE_LAST = NORMAL,
+ NAVIGATE_TYPE_LAST = UNSPECIFIED,
};
+
+ static bool IsReload(Value value) {
+ return value == RELOAD || value == RELOAD_BYPASSING_CACHE ||
+ value == RELOAD_ORIGINAL_REQUEST_URL;
+ }
+
+ static bool IsSameDocument(Value value) {
+ return value == SAME_DOCUMENT || value == HISTORY_SAME_DOCUMENT;
+ }
+
+ static bool IsHistory(Value value) {
+ return value == HISTORY_SAME_DOCUMENT ||
+ value == HISTORY_DIFFERENT_DOCUMENT;
+ }
};
struct FrameMsg_UILoadMetricsReportType {

Powered by Google App Engine
This is Rietveld 408576698