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

Unified Diff: extensions/browser/event_router.cc

Issue 2523913003: Fix bugs in filtered event removal code (Closed)
Patch Set: sync @tott Created 4 years 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 | « extensions/browser/event_router.h ('k') | extensions/browser/event_router_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/event_router.cc
diff --git a/extensions/browser/event_router.cc b/extensions/browser/event_router.cc
index 13b8b56ed4c2110a3cc3d284b8e466bc946f9948..0dc125a0626916546f4ed329fc6a24867e07dbd2 100644
--- a/extensions/browser/event_router.cc
+++ b/extensions/browser/event_router.cc
@@ -397,7 +397,7 @@ void EventRouter::AddFilterToEvent(const std::string& event_name,
filtered_events = update.Create();
ListValue* filter_list = nullptr;
- if (!filtered_events->GetList(event_name, &filter_list)) {
+ if (!filtered_events->GetListWithoutPathExpansion(event_name, &filter_list)) {
filter_list = new ListValue;
filtered_events->SetWithoutPathExpansion(event_name,
base::WrapUnique(filter_list));
@@ -419,10 +419,10 @@ void EventRouter::RemoveFilterFromEvent(const std::string& event_name,
}
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);
+ DictionaryValue* filter_value = nullptr;
+ CHECK(filter_list->GetDictionary(i, &filter_value));
+ if (filter_value->Equals(filter)) {
+ filter_list->Remove(i, nullptr);
break;
}
}
« no previous file with comments | « extensions/browser/event_router.h ('k') | extensions/browser/event_router_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698