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

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

Issue 2498223002: arc: enable use_new_wrapper_types for intent_helper.mojom (Closed)
Patch Set: review 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: 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 7c9db064f5af3bcffb304943fdb4df00799fb989..78ef0b413e54b43a06cedd02d9f138b708544dd5 100644
--- a/components/arc/intent_helper/intent_filter.cc
+++ b/components/arc/intent_helper/intent_filter.cc
@@ -11,13 +11,17 @@
namespace arc {
IntentFilter::IntentFilter(const mojom::IntentFilterPtr& mojo_intent_filter) {
Luis Héctor Chávez 2016/11/16 03:22:02 This looks like another candidate for typemaps.
Yusuke Sato 2016/11/16 06:10:21 Added TODO and filed a bug.
- for (const mojom::AuthorityEntryPtr& authorityptr :
- mojo_intent_filter->data_authorities) {
- authorities_.emplace_back(authorityptr);
+ if (mojo_intent_filter->data_authorities.has_value()) {
+ for (const mojom::AuthorityEntryPtr& authorityptr :
+ *mojo_intent_filter->data_authorities) {
+ authorities_.emplace_back(authorityptr);
+ }
}
- for (const mojom::PatternMatcherPtr& pattern :
- mojo_intent_filter->data_paths) {
- paths_.emplace_back(pattern);
+ if (mojo_intent_filter->data_paths.has_value()) {
+ for (const mojom::PatternMatcherPtr& pattern :
+ *mojo_intent_filter->data_paths) {
+ paths_.emplace_back(pattern);
+ }
}
}
@@ -67,7 +71,7 @@ bool IntentFilter::MatchDataAuthority(const GURL& url) const {
IntentFilter::AuthorityEntry::AuthorityEntry(
const mojom::AuthorityEntryPtr& entry)
- : host_(entry->host.get()), port_(entry->port) {
+ : host_(entry->host), port_(entry->port) {
// Wildcards are only allowed at the front of the host string.
wild_ = !host_.empty() && host_[0] == '*';
if (wild_) {
@@ -112,7 +116,7 @@ bool IntentFilter::AuthorityEntry::Match(const GURL& url) const {
IntentFilter::PatternMatcher::PatternMatcher(
const mojom::PatternMatcherPtr& pattern)
- : pattern_(pattern->pattern.get()), match_type_(pattern->type) {}
+ : pattern_(pattern->pattern), match_type_(pattern->type) {}
// Transcribed from android's PatternMatcher#matchPattern.
bool IntentFilter::PatternMatcher::Match(const std::string& str) const {

Powered by Google App Engine
This is Rietveld 408576698