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

Unified Diff: chrome/browser/net/chrome_url_request_context_getter.cc

Issue 2458093003: Add DCHECKs to validate ProfileIOData's list of protocols.
Patch Set: Merge remote-tracking branch 'origin/master' into detect_unregistered_schemes Created 4 years, 1 month 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: chrome/browser/net/chrome_url_request_context_getter.cc
diff --git a/chrome/browser/net/chrome_url_request_context_getter.cc b/chrome/browser/net/chrome_url_request_context_getter.cc
index e95e09eb00695de558590d5f7e3b7d0c3772aabb..9cf4f2deb057c8bb3578fd803c9d3bc4490cca2d 100644
--- a/chrome/browser/net/chrome_url_request_context_getter.cc
+++ b/chrome/browser/net/chrome_url_request_context_getter.cc
@@ -49,6 +49,10 @@ class FactoryForMain : public ChromeURLRequestContextFactory {
: profile_io_data_(profile_io_data),
request_interceptors_(std::move(request_interceptors)) {
std::swap(protocol_handlers_, *protocol_handlers);
+#if DCHECK_IS_ON()
+ for (const auto& handler : protocol_handlers_)
+ DCHECK(ProfileIOData::IsBuiltInProtocol(handler.first));
+#endif
}
net::URLRequestContext* Create() override {
« no previous file with comments | « chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc ('k') | chrome/browser/profiles/profile_io_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698