Descriptiondrive: 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 #
Messages
Total messages: 10 (0 generated)
|