Chromium Code Reviews
Help | Chromium Project | Sign in
(1)

Issue 2686463003: [Extensions] Fix a data race in ChromeExtensionMessageFilter. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
2 weeks, 4 days ago by atuchin
Modified:
1 week, 1 day ago
Reviewers:
Devlin
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Extensions] Fix a data race in ChromeExtensionMessageFilter. There is a data race in OnGetExtMessageBundleOnBlockingPool method. It calls InfoMap::extensions() on a blocking pool, but all InfoMap methods must be called on the IO thread. This CL does the following: 1. Add DCHECK_CURRENTRY_ON(..) in extensions::InfoMap. With those DCHECKs browser_tests.ExtensionApiTest.SharedModuleLocale starts crashing (because of a wrong thread). 2. Remove calls to IO-only methods from LoadMessageBundleSubstitutionMapWithImport and rename that function. 3. Use OnGetExtMessageBundle to collect all necessary information before posting a task to a blocking pool. 4. Remove NOTREACHED(), because an extension might be removed before OnGetExtMessageBundle message was received. TEST=browser_tests.ExtensionApiTest.SharedModuleLocale BUG= Review-Url: https://codereview.chromium.org/2686463003 Cr-Commit-Position: refs/heads/master@{#451339} Committed: https://chromium.googlesource.com/chromium/src/+/54e8d335c0e4bebe49fbb2cacc5e49c06f29dc6e

Patch Set 1 #

Patch Set 2 : [Extensions] Fix a data race in ChromeExtensionMessageFilter. #

Total comments: 7

Patch Set 3 : [Extensions] Fix a data race in ChromeExtensionMessageFilter. #

Total comments: 8

Patch Set 4 : [Extensions] Fix a data race in ChromeExtensionMessageFilter. #

Total comments: 4

Patch Set 5 : [Extensions] Fix a data race in ChromeExtensionMessageFilter. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+95 lines, -73 lines) Patch
M chrome/browser/renderer_host/chrome_extension_message_filter.h View 2 chunks +4 lines, -1 line 0 comments Download
M chrome/browser/renderer_host/chrome_extension_message_filter.cc View 1 2 3 4 2 chunks +51 lines, -7 lines 0 comments Download
M extensions/browser/info_map.h View 1 chunk +2 lines, -4 lines 0 comments Download
M extensions/browser/info_map.cc View 1 2 3 4 1 chunk +10 lines, -0 lines 0 comments Download
M extensions/common/file_util.h View 1 2 3 2 chunks +11 lines, -6 lines 0 comments Download
M extensions/common/file_util.cc View 1 2 3 2 chunks +17 lines, -55 lines 0 comments Download
Commit queue not available (can’t edit this change).

Messages

Total messages: 20 (8 generated)
atuchin
https://codereview.chromium.org/2686463003/diff/20001/extensions/common/file_util.cc File extensions/common/file_util.cc (right): https://codereview.chromium.org/2686463003/diff/20001/extensions/common/file_util.cc#newcode536 extensions/common/file_util.cc:536: MessageBundle::SubstitutionMap* LoadMessageBundleSubstitutionMapFromPaths( In addition: What do you think about ...
2 weeks, 3 days ago (2017-02-08 05:51:42 UTC) #3
atuchin
On 2017/02/08 05:51:42, atuchin wrote: > https://codereview.chromium.org/2686463003/diff/20001/extensions/common/file_util.cc > File extensions/common/file_util.cc (right): > > https://codereview.chromium.org/2686463003/diff/20001/extensions/common/file_util.cc#newcode536 > ...
2 weeks, 1 day ago (2017-02-10 06:29:57 UTC) #5
Finnur
Devlin is a better candidate, I think.
2 weeks, 1 day ago (2017-02-10 15:00:08 UTC) #7
atuchin
On 2017/02/10 15:00:08, Finnur wrote: > Devlin is a better candidate, I think. Ping.
1 week, 4 days ago (2017-02-14 05:22:55 UTC) #8
Devlin
Mostly good, with one suggestion for an optimization. Thanks for the patch! :) https://codereview.chromium.org/2686463003/diff/20001/chrome/browser/renderer_host/chrome_extension_message_filter.cc File ...
1 week, 4 days ago (2017-02-14 17:45:49 UTC) #9
atuchin
Thanks for comments. PTAL! https://codereview.chromium.org/2686463003/diff/20001/chrome/browser/renderer_host/chrome_extension_message_filter.cc File chrome/browser/renderer_host/chrome_extension_message_filter.cc (right): https://codereview.chromium.org/2686463003/diff/20001/chrome/browser/renderer_host/chrome_extension_message_filter.cc#newcode239 chrome/browser/renderer_host/chrome_extension_message_filter.cc:239: extensions::LocaleInfo::GetDefaultLocale(extension), reply_msg)); On 2017/02/14 17:45:49, ...
1 week, 3 days ago (2017-02-15 08:17:29 UTC) #10
Devlin
Nice! Just a few last nits. https://codereview.chromium.org/2686463003/diff/40001/chrome/browser/renderer_host/chrome_extension_message_filter.cc File chrome/browser/renderer_host/chrome_extension_message_filter.cc (right): https://codereview.chromium.org/2686463003/diff/40001/chrome/browser/renderer_host/chrome_extension_message_filter.cc#newcode234 chrome/browser/renderer_host/chrome_extension_message_filter.cc:234: const std::string default_locale ...
1 week, 2 days ago (2017-02-16 16:20:56 UTC) #11
atuchin
Ок, all nits have fixed. Take a look. https://codereview.chromium.org/2686463003/diff/40001/chrome/browser/renderer_host/chrome_extension_message_filter.cc File chrome/browser/renderer_host/chrome_extension_message_filter.cc (right): https://codereview.chromium.org/2686463003/diff/40001/chrome/browser/renderer_host/chrome_extension_message_filter.cc#newcode234 chrome/browser/renderer_host/chrome_extension_message_filter.cc:234: const ...
1 week, 1 day ago (2017-02-17 06:22:02 UTC) #12
Devlin
lgtm; thanks for your work here! :) https://codereview.chromium.org/2686463003/diff/60001/chrome/browser/renderer_host/chrome_extension_message_filter.cc File chrome/browser/renderer_host/chrome_extension_message_filter.cc (right): https://codereview.chromium.org/2686463003/diff/60001/chrome/browser/renderer_host/chrome_extension_message_filter.cc#newcode236 chrome/browser/renderer_host/chrome_extension_message_filter.cc:236: if (default_locale.empty()) ...
1 week, 1 day ago (2017-02-17 15:57:39 UTC) #13
atuchin
Thanks for the review. https://codereview.chromium.org/2686463003/diff/60001/chrome/browser/renderer_host/chrome_extension_message_filter.cc File chrome/browser/renderer_host/chrome_extension_message_filter.cc (right): https://codereview.chromium.org/2686463003/diff/60001/chrome/browser/renderer_host/chrome_extension_message_filter.cc#newcode236 chrome/browser/renderer_host/chrome_extension_message_filter.cc:236: if (default_locale.empty()) { On 2017/02/17 ...
1 week, 1 day ago (2017-02-17 16:22:47 UTC) #14
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/2686463003/80001
1 week, 1 day ago (2017-02-17 16:23:23 UTC) #17
commit-bot: I haz the power
1 week, 1 day ago (2017-02-17 18:13:07 UTC) #20
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as
https://chromium.googlesource.com/chromium/src/+/54e8d335c0e4bebe49fbb2cacc5e...
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f8e48bd