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

Unified Diff: chrome/browser/chrome_browser_main_linux.cc

Issue 12334096: Regularize ownerships and lifecycle for storage monitor platform classes. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Document lifecycle in storage_monitor.h Created 7 years, 10 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/chrome_browser_main_linux.cc
diff --git a/chrome/browser/chrome_browser_main_linux.cc b/chrome/browser/chrome_browser_main_linux.cc
index d7d1c2cbf96a89da05760be962510a10970bb65f..0749c51a2eab99a1def067f444f8fe46e56595d7 100644
--- a/chrome/browser/chrome_browser_main_linux.cc
+++ b/chrome/browser/chrome_browser_main_linux.cc
@@ -5,9 +5,7 @@
#include "chrome/browser/chrome_browser_main_linux.h"
#include "base/message_loop_proxy.h"
Lei Zhang 2013/03/01 04:40:15 message_loop_proxy.h is no longer needed. chrome_s
Greg Billock 2013/03/01 18:00:50 Done.
-#include "chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux.h"
#include "chrome/common/chrome_switches.h"
-#include "device/media_transfer_protocol/media_transfer_protocol_manager.h"
#if !defined(OS_CHROMEOS)
#include "chrome/browser/storage_monitor/removable_device_notifications_linux.h"
@@ -108,13 +106,10 @@ bool IsCrashReportingEnabled(const PrefService* local_state) {
ChromeBrowserMainPartsLinux::ChromeBrowserMainPartsLinux(
const content::MainFunctionParams& parameters)
- : ChromeBrowserMainPartsPosix(parameters),
- initialized_media_transfer_protocol_manager_(false) {
+ : ChromeBrowserMainPartsPosix(parameters) {
}
ChromeBrowserMainPartsLinux::~ChromeBrowserMainPartsLinux() {
- if (initialized_media_transfer_protocol_manager_)
- device::MediaTransferProtocolManager::Shutdown();
}
void ChromeBrowserMainPartsLinux::PreProfileInit() {
@@ -135,30 +130,15 @@ void ChromeBrowserMainPartsLinux::PreProfileInit() {
const base::FilePath kDefaultMtabPath("/etc/mtab");
removable_device_notifications_linux_ =
new chrome::RemovableDeviceNotificationsLinux(kDefaultMtabPath);
- removable_device_notifications_linux_->Init();
#endif
- if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)) {
- scoped_refptr<base::MessageLoopProxy> loop_proxy;
-#if !defined(OS_CHROMEOS)
- loop_proxy = content::BrowserThread::GetMessageLoopProxyForThread(
- content::BrowserThread::FILE);
-#endif
- device::MediaTransferProtocolManager::Initialize(loop_proxy);
- initialized_media_transfer_protocol_manager_ = true;
- }
-
ChromeBrowserMainPartsPosix::PreProfileInit();
}
void ChromeBrowserMainPartsLinux::PostProfileInit() {
- // TODO(gbillock): Make this owned by RemovableDeviceNotificationsLinux.
- if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)) {
- media_transfer_protocol_device_observer_.reset(
- new chrome::MediaTransferProtocolDeviceObserverLinux());
- media_transfer_protocol_device_observer_->SetNotifications(
- chrome::StorageMonitor::GetInstance()->receiver());
- }
+#if !defined(OS_CHROMEOS)
+ removable_device_notifications_linux_->Init();
+#endif
ChromeBrowserMainPartsPosix::PostProfileInit();
}
@@ -171,7 +151,5 @@ void ChromeBrowserMainPartsLinux::PostMainMessageLoopRun() {
removable_device_notifications_linux_ = NULL;
#endif
- media_transfer_protocol_device_observer_.reset();
-
ChromeBrowserMainPartsPosix::PostMainMessageLoopRun();
}

Powered by Google App Engine
This is Rietveld 408576698