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

Issue 13776005: drive: Fix two instances of madness in FileBrowserEventRouter (Closed)

Created:
7 years, 8 months ago by satorux1
Modified:
7 years, 8 months ago
Reviewers:
hashimoto
CC:
chromium-reviews, nkostylev+watch_chromium.org, Aaron Boodman, rginda+watch_chromium.org, oshima+watch_chromium.org, chromium-apps-reviews_chromium.org, stevenjb+watch_chromium.org, davemoore+watch_chromium.org
Visibility:
Public.

Description

drive: Fix two instances of madness in FileBrowserEventRouter 1) Being a ref counted class Previously, FileBrowserEventRouter was a ref counted class, but the weak pointer was also used, which doesn't make much sense. Being a ref counted class was bad, as lifetime of FileBrowserEventRouter was unclear, and FileBrowserEventRouter could outlive things like DBusThreadManager and PrefService in rare cases, which caused crash at shutdown. 2) Use of a mutex lock The lock was used to protect |file_watchers_|, which was accessed from FILE and UI threads, which should be avoided. Interaction between FILE and UI threads were also hard to read. BUG=227477, 227483 TEST=Open Downloads in Files.app. Download a file to Downloads. Confirm that the new file appears in Files.app immediatley. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=192993

Patch Set 1 #

Total comments: 10

Patch Set 2 : fix #

Total comments: 6

Patch Set 3 : rebase #

Patch Set 4 : address comments #

Total comments: 5

Patch Set 5 : address comments #

Patch Set 6 : address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+181 lines, -108 lines) Patch
M chrome/browser/chromeos/extensions/file_browser_event_router.h View 1 2 3 4 5 5 chunks +37 lines, -17 lines 0 comments Download
M chrome/browser/chromeos/extensions/file_browser_event_router.cc View 1 2 3 11 chunks +94 lines, -41 lines 0 comments Download
M chrome/browser/chromeos/extensions/file_browser_event_router_browsertest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/extensions/file_browser_private_api.h View 1 2 3 4 chunks +17 lines, -18 lines 0 comments Download
M chrome/browser/chromeos/extensions/file_browser_private_api.cc View 1 2 3 3 chunks +32 lines, -31 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
satorux1
7 years, 8 months ago (2013-04-08 09:26:17 UTC) #1
hashimoto
https://codereview.chromium.org/13776005/diff/1/chrome/browser/chromeos/extensions/file_browser_event_router.h File chrome/browser/chromeos/extensions/file_browser_event_router.h (right): https://codereview.chromium.org/13776005/diff/1/chrome/browser/chromeos/extensions/file_browser_event_router.h#newcode74 chrome/browser/chromeos/extensions/file_browser_event_router.h:74: bool AddFileWatch(const base::FilePath& local_path, A method returning bool while ...
7 years, 8 months ago (2013-04-08 11:10:26 UTC) #2
satorux1
https://codereview.chromium.org/13776005/diff/1/chrome/browser/chromeos/extensions/file_browser_event_router.h File chrome/browser/chromeos/extensions/file_browser_event_router.h (right): https://codereview.chromium.org/13776005/diff/1/chrome/browser/chromeos/extensions/file_browser_event_router.h#newcode74 chrome/browser/chromeos/extensions/file_browser_event_router.h:74: bool AddFileWatch(const base::FilePath& local_path, On 2013/04/08 11:10:26, hashimoto wrote: ...
7 years, 8 months ago (2013-04-09 01:24:38 UTC) #3
hashimoto
lgtm https://codereview.chromium.org/13776005/diff/16001/chrome/browser/chromeos/extensions/file_browser_event_router.h File chrome/browser/chromeos/extensions/file_browser_event_router.h (right): https://codereview.chromium.org/13776005/diff/16001/chrome/browser/chromeos/extensions/file_browser_event_router.h#newcode144 chrome/browser/chromeos/extensions/file_browser_event_router.h:144: // Starts a file watch at |local_path|. |file_path_watcher| ...
7 years, 8 months ago (2013-04-09 01:34:09 UTC) #4
satorux1
https://codereview.chromium.org/13776005/diff/16001/chrome/browser/chromeos/extensions/file_browser_event_router.h File chrome/browser/chromeos/extensions/file_browser_event_router.h (right): https://codereview.chromium.org/13776005/diff/16001/chrome/browser/chromeos/extensions/file_browser_event_router.h#newcode148 chrome/browser/chromeos/extensions/file_browser_event_router.h:148: // |successfully, or false if failed. |callback| must not ...
7 years, 8 months ago (2013-04-09 01:36:25 UTC) #5
hashimoto
https://codereview.chromium.org/13776005/diff/16001/chrome/browser/chromeos/extensions/file_browser_event_router.h File chrome/browser/chromeos/extensions/file_browser_event_router.h (right): https://codereview.chromium.org/13776005/diff/16001/chrome/browser/chromeos/extensions/file_browser_event_router.h#newcode144 chrome/browser/chromeos/extensions/file_browser_event_router.h:144: // Starts a file watch at |local_path|. |file_path_watcher| will ...
7 years, 8 months ago (2013-04-09 01:38:59 UTC) #6
satorux1
https://codereview.chromium.org/13776005/diff/16001/chrome/browser/chromeos/extensions/file_browser_event_router.h File chrome/browser/chromeos/extensions/file_browser_event_router.h (right): https://codereview.chromium.org/13776005/diff/16001/chrome/browser/chromeos/extensions/file_browser_event_router.h#newcode144 chrome/browser/chromeos/extensions/file_browser_event_router.h:144: // Starts a file watch at |local_path|. |file_path_watcher| will ...
7 years, 8 months ago (2013-04-09 01:41:21 UTC) #7
hashimoto
lgtm
7 years, 8 months ago (2013-04-09 01:47:16 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/satorux@chromium.org/13776005/28018
7 years, 8 months ago (2013-04-09 01:51:04 UTC) #9
satorux1
7 years, 8 months ago (2013-04-09 03:33:47 UTC) #10
Message was sent while issue was closed.
Committed patchset #6 manually as r192993 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698