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

Unified Diff: chrome/browser/ui/startup/startup_browser_creator_impl.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/ui/startup/startup_browser_creator_impl.cc
diff --git a/chrome/browser/ui/startup/startup_browser_creator_impl.cc b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
index 3a3aea13a33b8073d22daff879e45a471dee66d8..b63b0347938807a59670572623cc97cc4a7e2fa6 100644
--- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc
+++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
@@ -424,15 +424,18 @@ Browser* StartupBrowserCreatorImpl::OpenTabsInBrowser(Browser* browser,
browser = new Browser(Browser::CreateParams(profile_));
bool first_tab = true;
- ProtocolHandlerRegistry* registry = profile_ ?
- ProtocolHandlerRegistryFactory::GetForBrowserContext(profile_) : NULL;
+ ProtocolHandlerRegistry* web_based_protocol_handlers =
+ profile_ ? ProtocolHandlerRegistryFactory::GetForBrowserContext(profile_)
+ : NULL;
for (size_t i = 0; i < tabs.size(); ++i) {
// We skip URLs that we'd have to launch an external protocol handler for.
// This avoids us getting into an infinite loop asking ourselves to open
// a URL, should the handler be (incorrectly) configured to be us. Anyone
// asking us to open such a URL should really ask the handler directly.
- bool handled_by_chrome = ProfileIOData::IsHandledURL(tabs[i].url) ||
- (registry && registry->IsHandledProtocol(tabs[i].url.scheme()));
+ bool handled_by_chrome =
+ ProfileIOData::HasBuiltInProtocol(tabs[i].url) ||
+ (web_based_protocol_handlers &&
+ web_based_protocol_handlers->IsHandledProtocol(tabs[i].url.scheme()));
if (!process_startup && !handled_by_chrome)
continue;
« no previous file with comments | « chrome/browser/renderer_context_menu/render_view_context_menu.cc ('k') | content/browser/storage_partition_impl_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698