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

Issue 16187002: Allow the consumer of storage monitor to register callback when the initialization is completed. (Closed)

Created:
7 years, 6 months ago by Hongbo Min
Modified:
7 years, 6 months ago
CC:
chromium-reviews, hokein.wu_gmail.com
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Allow the consumer of storage monitor to register callback when the initialization is completed. It is intended to allow the consumer of storage monitor to decide calling GetAllAvailableStorages or GetAttachedStorage to fetch the correct results. BUG=None

Patch Set 1 : #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+11 lines, -2 lines) Patch
M chrome/browser/storage_monitor/storage_monitor.h View 1 chunk +6 lines, -0 lines 2 comments Download
M chrome/browser/storage_monitor/storage_monitor.cc View 2 chunks +5 lines, -2 lines 2 comments Download

Messages

Total messages: 8 (0 generated)
Hongbo Min
Please have a review. Thanks.
7 years, 6 months ago (2013-05-29 06:48:37 UTC) #1
Hongbo Min
https://codereview.chromium.org/16187002/diff/3001/chrome/browser/storage_monitor/storage_monitor.cc File chrome/browser/storage_monitor/storage_monitor.cc (right): https://codereview.chromium.org/16187002/diff/3001/chrome/browser/storage_monitor/storage_monitor.cc#newcode64 chrome/browser/storage_monitor/storage_monitor.cc:64: void StorageMonitor::Initialize(base::Closure callback) { What is the Initialize used ...
7 years, 6 months ago (2013-05-29 06:53:00 UTC) #2
wrong vandebo
https://codereview.chromium.org/16187002/diff/3001/chrome/browser/storage_monitor/storage_monitor.h File chrome/browser/storage_monitor/storage_monitor.h (right): https://codereview.chromium.org/16187002/diff/3001/chrome/browser/storage_monitor/storage_monitor.h#newcode71 chrome/browser/storage_monitor/storage_monitor.h:71: void RegisterInitCompletedCallback(base::Closure callback); I don't understand why you would ...
7 years, 6 months ago (2013-05-29 15:08:34 UTC) #3
Hongbo Min
https://codereview.chromium.org/16187002/diff/3001/chrome/browser/storage_monitor/storage_monitor.h File chrome/browser/storage_monitor/storage_monitor.h (right): https://codereview.chromium.org/16187002/diff/3001/chrome/browser/storage_monitor/storage_monitor.h#newcode71 chrome/browser/storage_monitor/storage_monitor.h:71: void RegisterInitCompletedCallback(base::Closure callback); On 2013/05/29 15:08:35, vandebo1 wrote: > ...
7 years, 6 months ago (2013-05-29 15:15:39 UTC) #4
vandebo (ex-Chrome)
On 2013/05/29 15:15:39, Hongbo Min wrote: > https://codereview.chromium.org/16187002/diff/3001/chrome/browser/storage_monitor/storage_monitor.h > File chrome/browser/storage_monitor/storage_monitor.h (right): > > https://codereview.chromium.org/16187002/diff/3001/chrome/browser/storage_monitor/storage_monitor.h#newcode71 ...
7 years, 6 months ago (2013-05-29 15:20:27 UTC) #5
Hongbo Min
On 2013/05/29 15:20:27, vandebo wrote: > On 2013/05/29 15:15:39, Hongbo Min wrote: > > > ...
7 years, 6 months ago (2013-05-29 15:25:55 UTC) #6
vandebo (ex-Chrome)
On 2013/05/29 15:25:55, Hongbo Min wrote: > On 2013/05/29 15:20:27, vandebo wrote: > > On ...
7 years, 6 months ago (2013-05-29 15:42:44 UTC) #7
Greg Billock
7 years, 6 months ago (2013-05-29 17:46:33 UTC) #8
https://codereview.chromium.org/16187002/diff/3001/chrome/browser/storage_mon...
File chrome/browser/storage_monitor/storage_monitor.cc (right):

https://codereview.chromium.org/16187002/diff/3001/chrome/browser/storage_mon...
chrome/browser/storage_monitor/storage_monitor.cc:64: void
StorageMonitor::Initialize(base::Closure callback) {
On 2013/05/29 06:53:00, Hongbo Min wrote:
> What is the Initialize used for?
> 
> If the StorageMonitor is changing to be created only when needed, could we use
> RegisterInitCompletionCallback to register the callbacks wanted and then call
> Init to query storage metadata? 

If your code needs an initialized storage monitor, you should just call
Initialize() yourself.

Meaning, when the monitor is lazily initialized, you must initialize it before
it'll start working. I think Steve suggested "EnsureInitialized" might be a
better name, which is probably true.

Powered by Google App Engine
This is Rietveld 408576698