Chromium Code Reviews| Index: extensions/common/event_matcher.cc |
| diff --git a/extensions/common/event_matcher.cc b/extensions/common/event_matcher.cc |
| index c9829373c9102a16a331066f346c19fb0e8d2eef..937c783745f5182d7bd539178afd220570fef496 100644 |
| --- a/extensions/common/event_matcher.cc |
| +++ b/extensions/common/event_matcher.cc |
| @@ -21,8 +21,9 @@ EventMatcher::~EventMatcher() { |
| bool EventMatcher::MatchNonURLCriteria( |
| const EventFilteringInfo& event_info) const { |
| - // There is currently no criteria apart from URL criteria. |
| - return true; |
| + if (!event_info.has_instance_id()) |
| + return true; |
| + return event_info.instance_id() == GetInstanceID(); |
| } |
| int EventMatcher::GetURLFilterCount() const { |
| @@ -44,4 +45,10 @@ int EventMatcher::HasURLFilters() const { |
| return GetURLFilterCount() != 0; |
| } |
| +int EventMatcher::GetInstanceID() const { |
| + int instance_id = 0; |
| + filter_->GetInteger("instanceId", &instance_id); |
|
Matt Perry
2013/06/18 23:29:02
Is 0 an invalid instanceId? (I'm wondering what wi
Fady Samuel
2013/06/19 01:15:16
Yes, 0 is an invalid instanceId. If a listener doe
|
| + return instance_id; |
| +} |
| + |
| } // namespace extensions |