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

Unified Diff: components/arc/intent_helper/intent_filter.cc

Issue 2166933002: [arc-intents] Deal correctly with default ports. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 years, 5 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 | components/arc/intent_helper/intent_filter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/arc/intent_helper/intent_filter.cc
diff --git a/components/arc/intent_helper/intent_filter.cc b/components/arc/intent_helper/intent_filter.cc
index ae3ecca024afffaa39531b50f72b82c93831db7c..4144e95c5592dd3eeff6dba3a793b9c481a3070f 100644
--- a/components/arc/intent_helper/intent_filter.cc
+++ b/components/arc/intent_helper/intent_filter.cc
@@ -84,7 +84,18 @@ bool IntentFilter::AuthorityEntry::match(const GURL& url) const {
return false;
}
- if (port_ >= 0 && port_ != url.IntPort()) {
+ // Note: On android, intent filters with explicit port specifications only
+ // match URLs with explict ports, even if the specified port is the default
+ // port. Using GURL::EffectiveIntPort instead of GURL::IntPort means that
+ // this code differs in behaviour (i.e. it just matches the effective port,
+ // ignoring whether it was implicitly or explicitly specified).
+ //
+ // We do this because it provides an optimistic match - ensuring that the
+ // disambiguation code doesn't miss URLs that might be handled by android
+ // apps. This doesn't cause misrouted intents because this check is followed
+ // up by a mojo call that actually verifies the list of packages that could
+ // accept the given intent.
+ if (port_ >= 0 && port_ != url.EffectiveIntPort()) {
return false;
}
« no previous file with comments | « no previous file | components/arc/intent_helper/intent_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698