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

Issue 2121873002: Fix WebRequest's EventListener::operator< (Closed)

Created:
4 years, 5 months ago by robwu
Modified:
4 years, 3 months ago
CC:
chromium-apps-reviews_chromium.org, chromium-reviews, extensions-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix 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/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+59 lines, -36 lines) Patch
M chrome/browser/extensions/api/web_request/web_request_api_unittest.cc View 1 2 1 chunk +32 lines, -0 lines 0 comments Download
M extensions/browser/api/web_request/web_request_api.h View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M extensions/browser/api/web_request/web_request_api.cc View 1 2 4 chunks +23 lines, -36 lines 0 comments Download

Messages

Total messages: 15 (8 generated)
robwu
4 years, 5 months ago (2016-07-08 07:57:48 UTC) #3
Ken Rockot(use gerrit already)
lgtm https://codereview.chromium.org/2121873002/diff/20001/extensions/browser/api/web_request/web_request_api.h File extensions/browser/api/web_request/web_request_api.h (right): https://codereview.chromium.org/2121873002/diff/20001/extensions/browser/api/web_request/web_request_api.h#newcode278 extensions/browser/api/web_request/web_request_api.h:278: int GetListenerCount(void* browser_context, const std::string& event_name); nit: GetListenerCountForTest?
4 years, 5 months ago (2016-07-08 15:53:33 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2121873002/40001
4 years, 5 months ago (2016-07-08 17:03:01 UTC) #7
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 5 months ago (2016-07-08 19:14:34 UTC) #9
commit-bot: I haz the power
CQ bit was unchecked.
4 years, 5 months ago (2016-07-08 19:14:35 UTC) #10
commit-bot: I haz the power
Patchset 3 (id:??) landed as https://crrev.com/c89943b168ef2ccc51f3ec0720e552f36ec31351 Cr-Commit-Position: refs/heads/master@{#404456}
4 years, 5 months ago (2016-07-08 19:15:43 UTC) #12
mmenke
4 years, 3 months ago (2016-09-01 21:30:44 UTC) #13
Message was sent while issue was closed.
A revert of this CL (patchset #3 id:40001) has been created in
https://codereview.chromium.org/2299373002/ by mmenke@chromium.org.

The reason for reverting is: This may have caused https://crbug.com/641958. 
Reverting to verify.  If it did not, I'll reland next week..

Powered by Google App Engine
This is Rietveld 408576698