DescriptionFix WebRequest's EventListener::operator<
std::set's count() method is expected to return 0 or 1. But due
to the fact that EventListener::operator< conditionally ignored
|embedder_process_id|, the count method could return more than 1
(e.g. 2) in release builds on Windows (VC++), and fail an assertion.
This assertion failure shows that the assumption about the uniqueness
of EventListeners (while ignoring the |embedder_process_id| value) does
not hold, i.e. there may be more than one non-webview EventListeners
with the same |extension_id| and |sub_event_name|, but different
|embedder_process_id|.
To fix this, this patch removes the conditional exclusion of
|embedder_process_id| from operator< and looks up |embedder_process_id|
before searching through the set.
BUG=589735
TEST=./unit_tests --gtest_filter=ExtensionWebRequestTest.AddAndRemoveListeners
Committed: https://crrev.com/c89943b168ef2ccc51f3ec0720e552f36ec31351
Cr-Commit-Position: refs/heads/master@{#404456}
Patch Set 1 #Patch Set 2 : Fix WebRequest's EventListener::operator< #
Total comments: 1
Patch Set 3 : s/GetListenerCount/GetListenerCountForTesting/ #
Messages
Total messages: 15 (8 generated)
|