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

Side by Side Diff: chrome/browser/storage_monitor/storage_monitor.cc

Issue 14556015: [Media Galleries] Lazily initialize the storage monitor. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Windows compile tweaks Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/storage_monitor/storage_monitor.h" 5 #include "chrome/browser/storage_monitor/storage_monitor.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/storage_monitor/removable_storage_observer.h" 9 #include "chrome/browser/storage_monitor/removable_storage_observer.h"
10 #include "chrome/browser/storage_monitor/transient_device_ids.h" 10 #include "chrome/browser/storage_monitor/transient_device_ids.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 // static 123 // static
124 void StorageMonitor::RemoveSingletonForTesting() { 124 void StorageMonitor::RemoveSingletonForTesting() {
125 g_storage_monitor = NULL; 125 g_storage_monitor = NULL;
126 } 126 }
127 127
128 StorageMonitor::Receiver* StorageMonitor::receiver() const { 128 StorageMonitor::Receiver* StorageMonitor::receiver() const {
129 return receiver_.get(); 129 return receiver_.get();
130 } 130 }
131 131
132 void StorageMonitor::MarkInitialized() { 132 void StorageMonitor::MarkInitialized() {
133 LOG(INFO) << "Marking initialized...";
133 initialized_ = true; 134 initialized_ = true;
134 for (std::vector<base::Closure>::iterator iter = 135 for (std::vector<base::Closure>::iterator iter =
135 on_initialize_callbacks_.begin(); 136 on_initialize_callbacks_.begin();
136 iter != on_initialize_callbacks_.end(); ++iter) { 137 iter != on_initialize_callbacks_.end(); ++iter) {
137 iter->Run(); 138 iter->Run();
138 } 139 }
139 on_initialize_callbacks_.clear(); 140 on_initialize_callbacks_.clear();
140 } 141 }
141 142
142 void StorageMonitor::ProcessAttach(const StorageInfo& info) { 143 void StorageMonitor::ProcessAttach(const StorageInfo& info) {
(...skipping 23 matching lines...) Expand all
166 info = it->second; 167 info = it->second;
167 storage_map_.erase(it); 168 storage_map_.erase(it);
168 } 169 }
169 170
170 DVLOG(1) << "RemovableStorageDetached for id " << id; 171 DVLOG(1) << "RemovableStorageDetached for id " << id;
171 observer_list_->Notify( 172 observer_list_->Notify(
172 &RemovableStorageObserver::OnRemovableStorageDetached, info); 173 &RemovableStorageObserver::OnRemovableStorageDetached, info);
173 } 174 }
174 175
175 } // namespace chrome 176 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698