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

Unified Diff: device/media_transfer_protocol/media_transfer_protocol_manager.cc

Issue 14016002: Storage Monitor: Make StorageMonitorLinux own the MediaTransferProtocolManager. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix browser_tests Created 7 years, 8 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
« no previous file with comments | « device/media_transfer_protocol/media_transfer_protocol_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/media_transfer_protocol/media_transfer_protocol_manager.cc
===================================================================
--- device/media_transfer_protocol/media_transfer_protocol_manager.cc (revision 194743)
+++ device/media_transfer_protocol/media_transfer_protocol_manager.cc (working copy)
@@ -35,7 +35,7 @@
// The MediaTransferProtocolManager implementation.
class MediaTransferProtocolManagerImpl : public MediaTransferProtocolManager {
public:
- MediaTransferProtocolManagerImpl(
+ explicit MediaTransferProtocolManagerImpl(
scoped_refptr<base::MessageLoopProxy> loop_proxy)
: weak_ptr_factory_(this) {
dbus::Bus* bus = NULL;
@@ -71,6 +71,9 @@
}
virtual ~MediaTransferProtocolManagerImpl() {
+ DCHECK(g_media_transfer_protocol_manager);
+ g_media_transfer_protocol_manager = NULL;
+ VLOG(1) << "MediaTransferProtocolManager Shutdown completed";
}
// MediaTransferProtocolManager override.
@@ -434,31 +437,14 @@
} // namespace
// static
-void MediaTransferProtocolManager::Initialize(
+MediaTransferProtocolManager* MediaTransferProtocolManager::Initialize(
scoped_refptr<base::MessageLoopProxy> loop_proxy) {
- if (g_media_transfer_protocol_manager) {
- LOG(WARNING) << "MediaTransferProtocolManager was already initialized";
- return;
- }
+ DCHECK(!g_media_transfer_protocol_manager);
+
g_media_transfer_protocol_manager =
new MediaTransferProtocolManagerImpl(loop_proxy);
VLOG(1) << "MediaTransferProtocolManager initialized";
-}
-// static
-void MediaTransferProtocolManager::Shutdown() {
- if (!g_media_transfer_protocol_manager) {
- LOG(WARNING) << "MediaTransferProtocolManager::Shutdown() called with "
- << "NULL manager";
- return;
- }
- delete g_media_transfer_protocol_manager;
- g_media_transfer_protocol_manager = NULL;
- VLOG(1) << "MediaTransferProtocolManager Shutdown completed";
-}
-
-// static
-MediaTransferProtocolManager* MediaTransferProtocolManager::GetInstance() {
return g_media_transfer_protocol_manager;
}
« no previous file with comments | « device/media_transfer_protocol/media_transfer_protocol_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698