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

Unified Diff: components/policy/core/browser/url_blacklist_manager.h

Issue 1692503002: Functionality to allow blacklist and whitelist of custom schemes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed review comments and merged Created 4 years, 8 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: components/policy/core/browser/url_blacklist_manager.h
diff --git a/components/policy/core/browser/url_blacklist_manager.h b/components/policy/core/browser/url_blacklist_manager.h
index db1763304ac07141b4ec12de41b81444d095da4f..64d0fca087c245af5fc10a73e7b662d0a24d825f 100644
--- a/components/policy/core/browser/url_blacklist_manager.h
+++ b/components/policy/core/browser/url_blacklist_manager.h
@@ -21,6 +21,7 @@
#include "components/policy/policy_export.h"
#include "components/prefs/pref_change_registrar.h"
#include "components/url_matcher/url_matcher.h"
+#include "net/base/network_delegate.h"
#include "url/gurl.h"
class PrefService;
@@ -62,12 +63,16 @@ class POLICY_EXPORT URLBlacklist {
// Returns true if the URL is blocked.
bool IsURLBlocked(const GURL& url) const;
+ net::NetworkDelegate::URLBlacklistState
+ GetURLBlacklistState(const GURL& url) const;
+
// Returns the number of items in the list.
size_t Size() const;
// Splits a URL filter into its components. A GURL isn't used because these
// can be invalid URLs e.g. "google.com".
- // Returns false if the URL couldn't be parsed.
+ // Returns false if the URL couldn't be parsed. In case false is returned,
+ // the values of output parameters are undefined.
// The |host| is preprocessed so it can be passed to URLMatcher for the
// appropriate condition.
// The optional username and password are ignored.
@@ -76,6 +81,7 @@ class POLICY_EXPORT URLBlacklist {
// |port| is 0 if none is explicitly defined.
// |path| does not include query parameters.
// |query| contains the query parameters ('?' not included).
+ // All arguments are mandatory.
static bool FilterToComponents(SegmentURLCallback segment_url,
const std::string& filter,
std::string* scheme,
@@ -160,6 +166,9 @@ class POLICY_EXPORT URLBlacklistManager {
// from the IO thread.
bool IsURLBlocked(const GURL& url) const;
+ net::NetworkDelegate::URLBlacklistState
+ GetURLBlacklistState(const GURL& url) const;
+
// Returns true if a request for |url| is blocked by the current blacklist.
//
// Should only be called for requests for frames (Main frames or subframes).

Powered by Google App Engine
This is Rietveld 408576698