| 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 1a0f79c45de5c93f2c27e2c16b4f3a5ee358290f..ae3ecca024afffaa39531b50f72b82c93831db7c 100644
|
| --- a/components/arc/intent_helper/intent_filter.cc
|
| +++ b/components/arc/intent_helper/intent_filter.cc
|
| @@ -19,10 +19,6 @@ IntentFilter::IntentFilter(const mojom::IntentFilterPtr& mojo_intent_filter) {
|
| mojo_intent_filter->data_paths) {
|
| paths_.emplace_back(pattern);
|
| }
|
| - for (const mojom::PatternMatcherPtr& pattern :
|
| - mojo_intent_filter->data_scheme_specific_parts) {
|
| - scheme_specific_parts_.emplace_back(pattern);
|
| - }
|
| }
|
|
|
| IntentFilter::IntentFilter(const IntentFilter& other) = default;
|
| @@ -40,11 +36,7 @@ bool IntentFilter::match(const GURL& url) const {
|
| return false;
|
| }
|
|
|
| - if (!scheme_specific_parts_.empty() && hasDataSchemeSpecificPart(url)) {
|
| - return true;
|
| - }
|
| -
|
| - // If there isn't any matching ssp, we need to match an authority.
|
| + // Match the authority and the path (if any).
|
| if (!authorities_.empty()) {
|
| return matchDataAuthority(url) && (paths_.empty() || hasDataPath(url));
|
| }
|
| @@ -52,21 +44,6 @@ bool IntentFilter::match(const GURL& url) const {
|
| return false;
|
| }
|
|
|
| -// Transcribed from android's IntentFilter#hasDataSchemeSpecificPart.
|
| -bool IntentFilter::hasDataSchemeSpecificPart(const GURL& url) const {
|
| - // The scheme-specific-part is the content of the URL minus the ref fragment.
|
| - GURL::Replacements replacements;
|
| - replacements.ClearRef();
|
| - const std::string ssp = url.ReplaceComponents(replacements).GetContent();
|
| -
|
| - for (const PatternMatcher& pattern : scheme_specific_parts_) {
|
| - if (pattern.match(ssp)) {
|
| - return true;
|
| - }
|
| - }
|
| - return false;
|
| -}
|
| -
|
| // Transcribed from android's IntentFilter#hasDataPath.
|
| bool IntentFilter::hasDataPath(const GURL& url) const {
|
| const std::string path = url.path();
|
| @@ -103,8 +80,9 @@ IntentFilter::AuthorityEntry::AuthorityEntry(
|
|
|
| // Transcribed from android's IntentFilter.AuthorityEntry#match.
|
| bool IntentFilter::AuthorityEntry::match(const GURL& url) const {
|
| - if (!url.has_host())
|
| + if (!url.has_host()) {
|
| return false;
|
| + }
|
|
|
| if (port_ >= 0 && port_ != url.IntPort()) {
|
| return false;
|
| @@ -143,7 +121,7 @@ bool IntentFilter::PatternMatcher::match(const std::string& str) const {
|
|
|
| // Transcribed from android's PatternMatcher#matchPattern.
|
| bool IntentFilter::PatternMatcher::matchGlob(const std::string& str) const {
|
| -#define GET_CHAR(s, i) (UNLIKELY(i >= s.length())) ? '\0' : s[i]
|
| +#define GET_CHAR(s, i) ((UNLIKELY(i >= s.length())) ? '\0' : s[i])
|
|
|
| const size_t NP = pattern_.length();
|
| const size_t NS = str.length();
|
|
|