There are couple of bugs I noticed:
1. There's a typo in filter comparison code in browser process:
void EventRouter::RemoveFilterFromEvent(const std::string& event_name,
const std::string& extension_id,
const DictionaryValue* filter) {
...
for (size_t i = 0; i < filter_list->GetSize(); i++) {
DictionaryValue* filter = NULL;
CHECK(filter_list->GetDictionary(i, &filter));
if (filter->Equals(filter)) { <- ###
filter_list->Remove(i, NULL);
break;
}
}
}
2. Filtered events are written in ExtensionPrefs under kFilteredEvents key.
But there's a bug EventRouter::RemoveFilterFromEvent code that doesn't
read the entries properly if an event has "." in its name (which is most
events?)
void EventRouter::RemoveFilterFromEvent(const std::string& event_name,
const std::string& extension_id,
const DictionaryValue* filter) {
...
if (!filtered_events ||
!filtered_events->GetList(event_name, &filter_list)) { <- ###
...
}
<- ### needs to be GetListWithoutPathExpansion instead.
Comment 1 by bugdroid1@chromium.org
, Dec 5 2016