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

Issue 108193008: Don't post tasks from RulesRegistry c-tor (Closed)

Created:
7 years ago by vabr (Chromium)
Modified:
7 years ago
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org, Fady Samuel
Visibility:
Public.

Description

Don't post tasks from RulesRegistry c-tor Because RR is refcounted, it is a bad idea to put |this| into temporary scoped_refptr during construction. The first patchset here only contains a whitespace change to make sure the use-after-free is reproducible on the trybots. BUG=328051 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=241831

Patch Set 1 #

Patch Set 2 : Fix #

Patch Set 3 : ready() now can return NULL #

Patch Set 4 : Now it also compiles #

Total comments: 2

Patch Set 5 : scoped_ptr<OneShotEvent> #

Patch Set 6 : Rebased on ToT #

Patch Set 7 : Don't try to use the delegate if there is none #

Patch Set 8 : Fix weak pointer dereference on a wrong thread #

Total comments: 4

Patch Set 9 : Rebased on ToT #

Patch Set 10 : Typo fixed #

Patch Set 11 : Creating event as signalled #

Unified diffs Side-by-side diffs Delta from patch set Stats (+15 lines, -11 lines) Patch
M chrome/browser/extensions/api/declarative/rules_registry.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +7 lines, -11 lines 0 comments Download
M extensions/common/one_shot_event.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +5 lines, -0 lines 0 comments Download
M extensions/common/one_shot_event.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 19 (0 generated)
vabr (Chromium)
Hi Jeffrey, Sorry to flood you with reviews, but you are really the expert here. ...
7 years ago (2013-12-12 16:23:27 UTC) #1
Fady Samuel
IIRC this won't work. If there is no RulesCacheDelegate, and MarkReady is never called then ...
7 years ago (2013-12-12 16:37:29 UTC) #2
Fady Samuel
See here: https://code.google.com/p/chromium/codesearch#chromium/src/chrome/browser/extensions/api/web_request/web_request_api.cc&sq=package:chromium&type=cs&l=1964
7 years ago (2013-12-12 16:39:42 UTC) #3
vabr (Chromium)
On 2013/12/12 16:39:42, Fady Samuel wrote: > See here: > https://code.google.com/p/chromium/codesearch#chromium/src/chrome/browser/extensions/api/web_request/web_request_api.cc&sq=package:chromium&type=cs&l=1964 Fady is right. In ...
7 years ago (2013-12-12 17:02:27 UTC) #4
vabr (Chromium)
All right, Jeffrey and Fady, Please take a look again. I tried once more without ...
7 years ago (2013-12-12 17:34:51 UTC) #5
Fady Samuel
https://codereview.chromium.org/108193008/diff/60001/chrome/browser/extensions/api/declarative/rules_registry.h File chrome/browser/extensions/api/declarative/rules_registry.h (right): https://codereview.chromium.org/108193008/diff/60001/chrome/browser/extensions/api/declarative/rules_registry.h#newcode71 chrome/browser/extensions/api/declarative/rules_registry.h:71: return (cache_delegate_) ? &ready_ : NULL; What about making ...
7 years ago (2013-12-12 17:54:39 UTC) #6
vabr (Chromium)
Hi Fady, Jeffrey. I addressed Fady's comment, and fixed a NULL de-reference I introduced. PTAL. ...
7 years ago (2013-12-13 16:03:33 UTC) #7
vabr (Chromium)
Quick update: added patch set 8 to fix dereferencing of cache_delegate_ on a wrong thread. ...
7 years ago (2013-12-13 16:46:37 UTC) #8
Fady Samuel
lgtm
7 years ago (2013-12-16 16:54:33 UTC) #9
vabr (Chromium)
Thanks, Fady. Jeffrey, do you have any comments? If not, could you please give me ...
7 years ago (2013-12-17 10:30:47 UTC) #10
Jeffrey Yasskin
https://codereview.chromium.org/108193008/diff/220001/chrome/browser/extensions/api/declarative/rules_registry.cc File chrome/browser/extensions/api/declarative/rules_registry.cc (left): https://codereview.chromium.org/108193008/diff/220001/chrome/browser/extensions/api/declarative/rules_registry.cc#oldcode95 chrome/browser/extensions/api/declarative/rules_registry.cc:95: base::Bind(&RulesRegistry::MarkReady, this, base::Time::Now())); Would this CL be simpler if ...
7 years ago (2013-12-17 22:55:05 UTC) #11
vabr (Chromium)
Thanks, Jeffrey. Please see my response to your comment about calling Signal() directly. Cheers, Vaclav ...
7 years ago (2013-12-18 12:01:50 UTC) #12
Jeffrey Yasskin
On Dec 18, 2013 4:01 AM, <vabr@chromium.org> wrote: > > Thanks, Jeffrey. > > Please ...
7 years ago (2013-12-18 16:39:27 UTC) #13
vabr (Chromium)
Hi Jeffrey, I know you suggested 2) (explicit detach method), but I'm not sure whether ...
7 years ago (2013-12-18 17:45:16 UTC) #14
Jeffrey Yasskin
lgtm
7 years ago (2013-12-18 17:56:54 UTC) #15
Jeffrey Yasskin
On Wed, Dec 18, 2013 at 9:45 AM, <vabr@chromium.org> wrote: > Hi Jeffrey, > > ...
7 years ago (2013-12-18 18:19:17 UTC) #16
vabr (Chromium)
On 2013/12/18 18:19:17, Jeffrey Yasskin wrote: > On Wed, Dec 18, 2013 at 9:45 AM, ...
7 years ago (2013-12-19 07:20:55 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/vabr@chromium.org/108193008/280001
7 years ago (2013-12-19 07:21:14 UTC) #18
commit-bot: I haz the power
7 years ago (2013-12-19 09:46:03 UTC) #19
Message was sent while issue was closed.
Change committed as 241831

Powered by Google App Engine
This is Rietveld 408576698