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

Unified Diff: ios/web/web_state/ui/crw_wk_navigation_states.h

Issue 2838593002: Allow storing null navigations in CRWWKNavigationStates. (Closed)
Patch Set: Rebased Created 3 years, 7 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
« no previous file with comments | « no previous file | ios/web/web_state/ui/crw_wk_navigation_states.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/ui/crw_wk_navigation_states.h
diff --git a/ios/web/web_state/ui/crw_wk_navigation_states.h b/ios/web/web_state/ui/crw_wk_navigation_states.h
index adbffccc9769a2ab681755468dfd20b0b8b354c3..0356d930521a101fd21ff5513bb81a630ee3f2bf 100644
--- a/ios/web/web_state/ui/crw_wk_navigation_states.h
+++ b/ios/web/web_state/ui/crw_wk_navigation_states.h
@@ -41,7 +41,10 @@ enum class WKNavigationState : int {
} // namespace web
// Stores states and navigation contexts for WKNavigation objects.
-// Allows looking up for last added navigation object.
+// Allows looking up for last added navigation object. null WKNavigation is a
+// valid navigation and treated as a unique key. WKWebView passes null
+// WKNavigation to WKNavigationDelegate callbacks if navigation represents
+// window opening action.
@interface CRWWKNavigationStates : NSObject
// Adds a new navigation if it was not added yet. If navigation was already
@@ -53,8 +56,8 @@ enum class WKNavigationState : int {
- (void)setState:(web::WKNavigationState)state
forNavigation:(WKNavigation*)navigation;
-// Removes given |navigation|. Fails if |navigation| does not exist. No-op if
-// |navigation| is null.
+// Removes given |navigation|. Fails if |navigation| does not exist.
+// |navigation| can be null.
- (void)removeNavigation:(WKNavigation*)navigation;
// Adds a new navigation if it was not added yet. If navigation was already
@@ -70,7 +73,8 @@ enum class WKNavigationState : int {
// WKNavigation which was added the most recently via |setState:forNavigation:|.
// Updating navigation state via |setState:forNavigation:| does not change the
-// last added navigation. Returns nil if there are no stored navigations.
+// last added navigation. Returns nil if there are no stored navigations or
+// last navigation was null.
- (WKNavigation*)lastAddedNavigation;
// State of WKNavigation which was added the most recently via
« no previous file with comments | « no previous file | ios/web/web_state/ui/crw_wk_navigation_states.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698