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

Unified Diff: chrome/browser/media_galleries/media_file_system_registry.cc

Issue 2654303002: Always call StorageMonitor::RemoveObserver in ~MediaFileSystemRegistry. (Closed)
Patch Set: add include Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/media_galleries/media_file_system_registry.cc
diff --git a/chrome/browser/media_galleries/media_file_system_registry.cc b/chrome/browser/media_galleries/media_file_system_registry.cc
index 617ccb95f01c4c7b500722d439667e377ea59331..f6c5d7e1d857848ef8a481dbe11629c0588a9092 100644
--- a/chrome/browser/media_galleries/media_file_system_registry.cc
+++ b/chrome/browser/media_galleries/media_file_system_registry.cc
@@ -12,6 +12,7 @@
#include "base/bind.h"
#include "base/callback.h"
#include "base/files/file_path.h"
+#include "base/logging.h"
#include "base/macros.h"
#include "base/memory/ptr_util.h"
#include "base/stl_util.h"
@@ -761,11 +762,8 @@ MediaFileSystemRegistry::MediaFileSystemRegistry()
}
MediaFileSystemRegistry::~MediaFileSystemRegistry() {
- // TODO(gbillock): This is needed because the unit test uses the
- // g_browser_process registry. We should create one in the unit test,
- // and then can remove this.
- if (StorageMonitor::GetInstance())
- StorageMonitor::GetInstance()->RemoveObserver(this);
+ DCHECK(StorageMonitor::GetInstance());
+ StorageMonitor::GetInstance()->RemoveObserver(this);
}
void MediaFileSystemRegistry::OnPermissionRemoved(

Powered by Google App Engine
This is Rietveld 408576698