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

Issue 2596273003: Remove ref-counting from FilePathWatcher. (Closed)

Created:
3 years, 12 months ago by fdoray
Modified:
3 years, 11 months ago
Reviewers:
Mark Mentovai, gab
CC:
chromium-reviews, vmpstr+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Remove ref-counting from FilePathWatcher. Keep the PlatformDelegate in a std::unique_ptr instead of a scoped_refptr in FilePathWatcher. Use weak ptrs when posting callbacks bound to a PlatformDelegate. With this change, it is guaranteed that a PlatformDelegate does not outlive its parent FilePathWatcher. This will allow multiple code simplifications in FilePathWatcher. BUG=675631 Review-Url: https://codereview.chromium.org/2596273003 Cr-Commit-Position: refs/heads/master@{#442404} Committed: https://chromium.googlesource.com/chromium/src/+/0ac2f0f892f6c9998134902dbc0fc3d78d8517a9

Patch Set 1 #

Patch Set 2 : self-review #

Patch Set 3 : self-review #

Total comments: 8

Patch Set 4 : rebase #

Patch Set 5 : CR gab #10 #

Patch Set 6 : self-review #

Total comments: 8

Patch Set 7 : CR gab #21 #

Total comments: 2

Patch Set 8 : fix build errors and add DISALLOW_COPY_AND_ASSIGN #

Patch Set 9 : fix mac build error #

Unified diffs Side-by-side diffs Delta from patch set Stats (+150 lines, -128 lines) Patch
M base/files/file_path_watcher.h View 1 2 3 4 5 chunks +7 lines, -10 lines 0 comments Download
M base/files/file_path_watcher_fsevents.h View 1 2 3 4 5 chunks +4 lines, -5 lines 0 comments Download
M base/files/file_path_watcher_fsevents.cc View 1 2 3 4 5 6 7 chunks +48 lines, -40 lines 0 comments Download
M base/files/file_path_watcher_kqueue.h View 1 2 3 4 2 chunks +1 line, -3 lines 0 comments Download
M base/files/file_path_watcher_kqueue.cc View 1 2 3 4 5 6 2 chunks +9 lines, -5 lines 0 comments Download
M base/files/file_path_watcher_linux.cc View 1 2 3 4 5 6 7 9 chunks +38 lines, -48 lines 0 comments Download
M base/files/file_path_watcher_mac.cc View 1 2 3 4 5 6 7 8 4 chunks +13 lines, -6 lines 0 comments Download
M base/files/file_path_watcher_stub.cc View 1 2 3 4 5 6 2 chunks +9 lines, -3 lines 0 comments Download
M base/files/file_path_watcher_win.cc View 1 2 3 4 5 6 7 8 chunks +21 lines, -8 lines 0 comments Download

Messages

Total messages: 41 (29 generated)
fdoray
PTAL https://codereview.chromium.org/2596273003/diff/40001/base/files/file_path_watcher_linux.cc File base/files/file_path_watcher_linux.cc (right): https://codereview.chromium.org/2596273003/diff/40001/base/files/file_path_watcher_linux.cc#newcode328 base/files/file_path_watcher_linux.cc:328: // cancelled). Cancel() is only called from ~FilePathWatcher ...
3 years, 12 months ago (2016-12-23 15:34:46 UTC) #9
gab
https://codereview.chromium.org/2596273003/diff/40001/base/files/file_path_watcher_linux.cc File base/files/file_path_watcher_linux.cc (right): https://codereview.chromium.org/2596273003/diff/40001/base/files/file_path_watcher_linux.cc#newcode325 base/files/file_path_watcher_linux.cc:325: // This method is invoked on the Inotify thread. ...
3 years, 12 months ago (2016-12-23 16:05:06 UTC) #10
fdoray
PTAnL https://codereview.chromium.org/2596273003/diff/40001/base/files/file_path_watcher_linux.cc File base/files/file_path_watcher_linux.cc (right): https://codereview.chromium.org/2596273003/diff/40001/base/files/file_path_watcher_linux.cc#newcode325 base/files/file_path_watcher_linux.cc:325: // This method is invoked on the Inotify ...
3 years, 12 months ago (2016-12-23 21:16:07 UTC) #18
gab
https://codereview.chromium.org/2596273003/diff/40001/base/files/file_path_watcher_linux.cc File base/files/file_path_watcher_linux.cc (right): https://codereview.chromium.org/2596273003/diff/40001/base/files/file_path_watcher_linux.cc#newcode331 base/files/file_path_watcher_linux.cc:331: weak_factory_.GetWeakPtr(), fired_watch, child, created, On 2016/12/23 21:16:07, fdoray wrote: ...
3 years, 11 months ago (2017-01-05 21:22:54 UTC) #21
fdoray
gab@: PTAnL mark@: Please review changes in base/files/file_path_watcher_fsevents.cc https://codereview.chromium.org/2596273003/diff/100001/base/files/file_path_watcher_fsevents.cc File base/files/file_path_watcher_fsevents.cc (right): https://codereview.chromium.org/2596273003/diff/100001/base/files/file_path_watcher_fsevents.cc#newcode78 base/files/file_path_watcher_fsevents.cc:78: DCHECK(!task_runner() ...
3 years, 11 months ago (2017-01-05 23:04:11 UTC) #25
gab
lgtm (and I'm happy with the ObjC code on second pass as well w/ your ...
3 years, 11 months ago (2017-01-09 17:21:39 UTC) #28
fdoray
https://codereview.chromium.org/2596273003/diff/120001/base/files/file_path_watcher_mac.cc File base/files/file_path_watcher_mac.cc (right): https://codereview.chromium.org/2596273003/diff/120001/base/files/file_path_watcher_mac.cc#newcode49 base/files/file_path_watcher_mac.cc:49: std::unique_ptr<PlatformDelegate> impl_; On 2017/01/09 17:21:39, gab wrote: > DISALLOW_... ...
3 years, 11 months ago (2017-01-09 21:30:21 UTC) #29
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/2596273003/140001
3 years, 11 months ago (2017-01-09 21:31:06 UTC) #32
commit-bot: I haz the power
Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds/132457) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, ...
3 years, 11 months ago (2017-01-09 21:42:14 UTC) #34
Mark Mentovai
LGTM
3 years, 11 months ago (2017-01-09 21:47:14 UTC) #35
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/2596273003/160001
3 years, 11 months ago (2017-01-09 21:55:02 UTC) #38
commit-bot: I haz the power
3 years, 11 months ago (2017-01-09 23:39:15 UTC) #41
Message was sent while issue was closed.
Committed patchset #9 (id:160001) as
https://chromium.googlesource.com/chromium/src/+/0ac2f0f892f6c9998134902dbc0f...

Powered by Google App Engine
This is Rietveld 408576698