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

Issue 10917166: Extend the capability of SystemMonitor to support watching storage free space change (Closed)

Created:
8 years, 3 months ago by Hongbo Min
Modified:
8 years, 3 months ago
CC:
chromium-reviews, erikwright+watch_chromium.org, Mihai Parparita -not on Chrome, willchan no longer on Chromium
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Extend the capability of SystemMonitor to support watching storage free space change. BUG=141229 TEST=None

Patch Set 1 #

Total comments: 4

Patch Set 2 : #

Total comments: 32

Patch Set 3 : Update patch according to vandebo's comments #

Patch Set 4 : Rebase and add available_capacity into the observer callback #

Total comments: 24

Patch Set 5 : updated patch #

Total comments: 18

Patch Set 6 : Update and add unit test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+306 lines, -7 lines) Patch
M base/system_monitor/system_monitor.h View 1 2 3 4 5 6 chunks +64 lines, -1 line 0 comments Download
M base/system_monitor/system_monitor.cc View 1 2 3 4 5 3 chunks +96 lines, -2 lines 0 comments Download
M base/system_monitor/system_monitor_unittest.cc View 1 2 3 4 5 3 chunks +85 lines, -1 line 0 comments Download
M chrome/browser/system_monitor/removable_device_notifications_chromeos.h View 1 2 3 4 5 2 chunks +5 lines, -0 lines 0 comments Download
chrome/browser/system_monitor/removable_device_notifications_chromeos.cc View 1 2 3 4 5 1 chunk +8 lines, -0 lines 0 comments Download
M chrome/browser/system_monitor/removable_device_notifications_linux.h View 1 2 3 4 2 chunks +6 lines, -1 line 0 comments Download
M chrome/browser/system_monitor/removable_device_notifications_linux.cc View 1 2 3 4 5 1 chunk +10 lines, -0 lines 0 comments Download
M chrome/browser/system_monitor/removable_device_notifications_mac.h View 1 2 3 4 5 2 chunks +6 lines, -1 line 0 comments Download
M chrome/browser/system_monitor/removable_device_notifications_mac.mm View 1 2 3 4 5 1 chunk +10 lines, -0 lines 0 comments Download
M chrome/browser/system_monitor/removable_device_notifications_window_win.h View 1 2 3 4 2 chunks +6 lines, -1 line 0 comments Download
M chrome/browser/system_monitor/removable_device_notifications_window_win.cc View 1 2 3 4 5 1 chunk +10 lines, -0 lines 0 comments Download

Messages

Total messages: 40 (0 generated)
Hongbo Min
vandebo, this CL is to extend the capacity of SystemMonitor for watching storage free space ...
8 years, 3 months ago (2012-09-10 14:37:50 UTC) #1
vandebo (ex-Chrome)
+cc willchan@ On 2012/09/10 14:37:50, Hongbo Min wrote: > BTW, where is the device notification ...
8 years, 3 months ago (2012-09-10 21:52:49 UTC) #2
Hongbo Min
On 2012/09/10 21:52:49, vandebo wrote: > I guess that's a fair point, but there's a ...
8 years, 3 months ago (2012-09-10 23:28:11 UTC) #3
Hongbo Min
Patch is updated. Pls have a review.
8 years, 3 months ago (2012-09-11 14:03:58 UTC) #4
vandebo (ex-Chrome)
http://codereview.chromium.org/10917166/diff/6001/base/system_monitor/system_monitor.cc File base/system_monitor/system_monitor.cc (right): http://codereview.chromium.org/10917166/diff/6001/base/system_monitor/system_monitor.cc#newcode128 base/system_monitor/system_monitor.cc:128: if (free_space_changed_observer_map_[path].get()) Use find(path) so that you don't add ...
8 years, 3 months ago (2012-09-11 22:49:27 UTC) #5
Hongbo Min
vandebo, the patch is updated. Pls review it again. Thanks. http://codereview.chromium.org/10917166/diff/6001/base/system_monitor/system_monitor.cc File base/system_monitor/system_monitor.cc (right): http://codereview.chromium.org/10917166/diff/6001/base/system_monitor/system_monitor.cc#newcode128 ...
8 years, 3 months ago (2012-09-12 09:24:31 UTC) #6
Hongbo Min
8 years, 3 months ago (2012-09-12 13:17:19 UTC) #7
Hongbo Min
If you have already fixed the thread safe issue you mentioned, please ignore it. http://codereview.chromium.org/10917166/diff/6001/base/system_monitor/system_monitor.h ...
8 years, 3 months ago (2012-09-12 14:07:32 UTC) #8
vandebo (ex-Chrome)
It seems there are a lot of details to get right. We're getting closer though. ...
8 years, 3 months ago (2012-09-12 17:54:47 UTC) #9
Hongbo Min
vandebo, the updated patch has a heavily refactor now according to your comments, including documentation. ...
8 years, 3 months ago (2012-09-13 13:40:53 UTC) #10
Hongbo Min
http://codereview.chromium.org/10917166/diff/6001/base/system_monitor/system_monitor.h File base/system_monitor/system_monitor.h (right): http://codereview.chromium.org/10917166/diff/6001/base/system_monitor/system_monitor.h#newcode168 base/system_monitor/system_monitor.h:168: virtual void OnStorageFreeSpaceChanged(const FilePath::StringType& path) {} On 2012/09/12 17:54:47, ...
8 years, 3 months ago (2012-09-13 13:48:14 UTC) #11
willchan no longer on Chromium
http://codereview.chromium.org/10917166/diff/8016/base/system_monitor/system_monitor.h File base/system_monitor/system_monitor.h (right): http://codereview.chromium.org/10917166/diff/8016/base/system_monitor/system_monitor.h#newcode123 base/system_monitor/system_monitor.h:123: // Power-related APIs It looks like a mix of ...
8 years, 3 months ago (2012-09-13 18:41:14 UTC) #12
vandebo (ex-Chrome)
On 2012/09/13 13:40:53, Hongbo Min wrote: > If it is good to you, I will ...
8 years, 3 months ago (2012-09-13 19:57:34 UTC) #13
vandebo (ex-Chrome)
http://codereview.chromium.org/10917166/diff/8016/base/system_monitor/system_monitor.h File base/system_monitor/system_monitor.h (right): http://codereview.chromium.org/10917166/diff/8016/base/system_monitor/system_monitor.h#newcode123 base/system_monitor/system_monitor.h:123: // Power-related APIs Added to my post M23 branch ...
8 years, 3 months ago (2012-09-13 20:08:41 UTC) #14
willchan no longer on Chromium
http://codereview.chromium.org/10917166/diff/8016/base/system_monitor/system_monitor.h File base/system_monitor/system_monitor.h (right): http://codereview.chromium.org/10917166/diff/8016/base/system_monitor/system_monitor.h#newcode228 base/system_monitor/system_monitor.h:228: void set_storage_free_space_delegate(StorageFreeSpaceDelegate* delegate); On 2012/09/13 20:08:41, vandebo wrote: > ...
8 years, 3 months ago (2012-09-13 20:24:33 UTC) #15
vandebo (ex-Chrome)
Hongbo, I spoke with willchan on chat. One result was issue 149059, which this change ...
8 years, 3 months ago (2012-09-13 21:19:18 UTC) #16
willchan no longer on Chromium
+jam Since that would require content/ changes, I went ahead and talked with jam@ offline. ...
8 years, 3 months ago (2012-09-13 22:10:47 UTC) #17
vandebo (ex-Chrome)
On 2012/09/13 22:10:47, willchan wrote: > +jam > > Since that would require content/ changes, ...
8 years, 3 months ago (2012-09-13 22:41:48 UTC) #18
jam
On 2012/09/13 22:41:48, vandebo wrote: > On 2012/09/13 22:10:47, willchan wrote: > > +jam > ...
8 years, 3 months ago (2012-09-13 23:36:39 UTC) #19
vandebo (ex-Chrome)
On 2012/09/13 23:36:39, John Abd-El-Malek wrote: > On 2012/09/13 22:41:48, vandebo wrote: > > On ...
8 years, 3 months ago (2012-09-13 23:40:23 UTC) #20
willchan no longer on Chromium
Yeah, I think this all snuck into SystemMonitor, because that's where the PowerObserver was. And ...
8 years, 3 months ago (2012-09-13 23:48:24 UTC) #21
vandebo (ex-Chrome)
On 2012/09/13 23:48:24, willchan wrote: > Yeah, I think this all snuck into SystemMonitor, because ...
8 years, 3 months ago (2012-09-13 23:55:28 UTC) #22
jam
On Thu, Sep 13, 2012 at 4:48 PM, William Chan (陈智昌) <willchan@chromium.org>wrote: > Yeah, I ...
8 years, 3 months ago (2012-09-14 00:03:33 UTC) #23
willchan no longer on Chromium
On Thu, Sep 13, 2012 at 4:55 PM, <vandebo@chromium.org> wrote: > On 2012/09/13 23:48:24, willchan ...
8 years, 3 months ago (2012-09-14 00:05:07 UTC) #24
jam
On Thu, Sep 13, 2012 at 4:40 PM, <vandebo@chromium.org> wrote: > On 2012/09/13 23:36:39, John ...
8 years, 3 months ago (2012-09-14 00:05:31 UTC) #25
jam
On Thu, Sep 13, 2012 at 5:05 PM, William Chan (陈智昌) <willchan@chromium.org>wrote: > On Thu, ...
8 years, 3 months ago (2012-09-14 00:08:19 UTC) #26
vandebo (ex-Chrome)
On 2012/09/14 00:08:19, John Abd-El-Malek wrote: > On Thu, Sep 13, 2012 at 5:05 PM, ...
8 years, 3 months ago (2012-09-14 00:09:50 UTC) #27
willchan no longer on Chromium
On Thu, Sep 13, 2012 at 5:09 PM, <vandebo@chromium.org> wrote: > On 2012/09/14 00:08:19, John ...
8 years, 3 months ago (2012-09-14 00:10:53 UTC) #28
jam
so, briefly looking at the new code being added to base, it seems that this ...
8 years, 3 months ago (2012-09-14 00:17:27 UTC) #29
Hongbo Min
On 2012/09/13 13:48:14, Hongbo Min wrote: > http://codereview.chromium.org/10917166/diff/6001/base/system_monitor/system_monitor.h > File base/system_monitor/system_monitor.h (right): > > http://codereview.chromium.org/10917166/diff/6001/base/system_monitor/system_monitor.h#newcode168 ...
8 years, 3 months ago (2012-09-14 03:20:54 UTC) #30
vandebo (ex-Chrome)
On 2012/09/14 03:20:54, Hongbo Min wrote: > On 2012/09/13 13:48:14, Hongbo Min wrote: > > ...
8 years, 3 months ago (2012-09-14 05:10:33 UTC) #31
Hongbo Min
On 2012/09/14 05:10:33, vandebo wrote: > On 2012/09/14 03:20:54, Hongbo Min wrote: > > On ...
8 years, 3 months ago (2012-09-14 05:58:46 UTC) #32
Hongbo Min
http://codereview.chromium.org/10917166/diff/8016/base/system_monitor/system_monitor.h File base/system_monitor/system_monitor.h (right): http://codereview.chromium.org/10917166/diff/8016/base/system_monitor/system_monitor.h#newcode64 base/system_monitor/system_monitor.h:64: // Since the client code may call these interfaces ...
8 years, 3 months ago (2012-09-14 06:04:36 UTC) #33
vandebo (ex-Chrome)
On 2012/09/14 05:58:46, Hongbo Min wrote: > On 2012/09/14 05:10:33, vandebo wrote: > > On ...
8 years, 3 months ago (2012-09-14 08:00:16 UTC) #34
vandebo (ex-Chrome)
http://codereview.chromium.org/10917166/diff/8016/base/system_monitor/system_monitor.h File base/system_monitor/system_monitor.h (right): http://codereview.chromium.org/10917166/diff/8016/base/system_monitor/system_monitor.h#newcode64 base/system_monitor/system_monitor.h:64: // Since the client code may call these interfaces ...
8 years, 3 months ago (2012-09-14 08:07:17 UTC) #35
Hongbo Min
On 2012/09/14 08:07:17, vandebo wrote: > http://codereview.chromium.org/10917166/diff/8016/base/system_monitor/system_monitor.h > File base/system_monitor/system_monitor.h (right): > > http://codereview.chromium.org/10917166/diff/8016/base/system_monitor/system_monitor.h#newcode64 > ...
8 years, 3 months ago (2012-09-14 08:56:58 UTC) #36
Hongbo Min
On 2012/09/14 08:00:16, vandebo wrote: > On 2012/09/14 05:58:46, Hongbo Min wrote: > > On ...
8 years, 3 months ago (2012-09-14 08:58:12 UTC) #37
vandebo (ex-Chrome)
On 2012/09/14 08:56:58, Hongbo Min wrote: > On 2012/09/14 08:07:17, vandebo wrote: > > > ...
8 years, 3 months ago (2012-09-14 16:37:19 UTC) #38
Hongbo Min
vandebo, the patch is updated now. Pls review it. The free space delegate is now ...
8 years, 3 months ago (2012-09-15 14:45:58 UTC) #39
Hongbo Min
8 years, 3 months ago (2012-09-19 11:21:33 UTC) #40
On 2012/09/15 14:45:58, Hongbo Min wrote:
> vandebo, the patch is updated now. Pls review it.
> 
> The free space delegate is now set in SystemMonitor ctor, and the value for
> delegate parameter accepted in ctor is NULL as default. But I didn't change
the
> SystemMonitor construction in the SystemMonitor consumer, e.g. chrome,
> content_shell etc. , since this changes may touch many source files, and I
think
> it is meaningless currently because the functionality for watching free space
is
> indeed not ready. It makes more sense to change them when the functionality is
> implemented in future or the SystemMonitor is refactored.
> 
> The unit test is added for SystemMonitor, but it only covers the case for
> Process* and Observer interfaces, it is actually not enough for mulitiple
thread
> environment. The testing for MT env is expected to be covered by the unittest
> for implementation.

I am considering whether it is worth adding free space watching capability into
SystemMonitor in this way. Now I prefer to close this CL because of the
SystemMonitor will be refactored and it may introduce additional effort on
refactoring work. 

Moreover, the current design needs to be polished again. The way of exposing
StorageFreeSpaceDelegate in SystemMonitor seems to not be sound enough. Let's
see SystemMonitor class responsibility again, it is designed to monitor the
system device changes, e.g. power status, device notification, free space
watcher, and may be more capabilities in future, each capability should be a
separate implementation.

I like the jam@ suggestion for implementing StorageFreeSpaceWatcher and
StorageFreeSpaceDelegate in a separate file located in chrome/browser.

Powered by Google App Engine
This is Rietveld 408576698