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

Unified Diff: chrome/browser/safe_browsing/ui_manager.h

Issue 1509073002: Fixes for Safe Browsing with unrelated pending navigations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review changes for comment #13-15 Created 5 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
« no previous file with comments | « chrome/browser/safe_browsing/threat_details_unittest.cc ('k') | chrome/browser/safe_browsing/ui_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/ui_manager.h
diff --git a/chrome/browser/safe_browsing/ui_manager.h b/chrome/browser/safe_browsing/ui_manager.h
index 191dcccfb220252e42762914624028056567febc..c0b2d93f06928b5c525f6ed0a6580844b01e6483 100644
--- a/chrome/browser/safe_browsing/ui_manager.h
+++ b/chrome/browser/safe_browsing/ui_manager.h
@@ -25,6 +25,10 @@ namespace base {
class Thread;
} // namespace base
+namespace content {
+class NavigationEntry;
+} // namespace content
+
namespace net {
class SSLInfo;
} // namespace net
@@ -47,8 +51,25 @@ class SafeBrowsingUIManager
UnsafeResource();
~UnsafeResource();
+ // Returns true if this UnsafeResource is a main frame load that was blocked
+ // while the navigation is still pending. Note that a main frame hit may not
+ // be blocking, eg. client side detection happens after the load is
+ // committed.
bool IsMainPageLoadBlocked() const;
+ // Returns the NavigationEntry for this resource (for a main frame hit) or
+ // for the page which contains this resource (for a subresource hit).
+ // This method must only be called while the UnsafeResource is still
+ // "valid".
+ // I.e,
+ // For MainPageLoadBlocked resources, it must not be called if the load
+ // was aborted (going back or replaced with a different navigation),
+ // or resumed (proceeded through warning or matched whitelist).
+ // For non-MainPageLoadBlocked resources, it must not be called if any
+ // other navigation has committed (whether by going back or unrelated
+ // navigations), though a pending navigation is okay.
+ content::NavigationEntry* GetNavigationEntryForResource() const;
+
GURL url;
GURL original_url;
std::vector<GURL> redirect_urls;
« no previous file with comments | « chrome/browser/safe_browsing/threat_details_unittest.cc ('k') | chrome/browser/safe_browsing/ui_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698