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

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

Issue 2159203003: [arc-intents] Deal correctly with default ports. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 c12288169b16a27d391113b43a8a843452aa53fc..f2772ccc3ab83e2f2e2b0783543aab1ebeb0fd42 100644
--- a/components/arc/intent_helper/intent_filter.cc
+++ b/components/arc/intent_helper/intent_filter.cc
@@ -85,7 +85,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