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

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: Fix comment name Created 7 years, 9 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 | « chrome/browser/chrome_browser_main_linux.h ('k') | chrome/browser/chrome_browser_main_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4f5c48aac063ea4a09f522d1d080471bbf6609d7..c15d05d63356347325af452ec1d585a48544e627 100644
--- a/chrome/browser/chrome_browser_main_linux.cc
+++ b/chrome/browser/chrome_browser_main_linux.cc
@@ -4,11 +4,6 @@
#include "chrome/browser/chrome_browser_main_linux.h"
-#include "base/message_loop_proxy.h"
-#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/storage_monitor_linux.h"
#include "content/public/browser/browser_thread.h"
@@ -21,6 +16,7 @@
#include "base/linux_util.h"
#include "base/prefs/pref_service.h"
#include "chrome/app/breakpad_linux.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/env_vars.h"
#include "chrome/common/pref_names.h"
@@ -108,13 +104,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() {
@@ -134,30 +127,15 @@ void ChromeBrowserMainPartsLinux::PreProfileInit() {
#if !defined(OS_CHROMEOS)
const base::FilePath kDefaultMtabPath("/etc/mtab");
storage_monitor_ = new chrome::StorageMonitorLinux(kDefaultMtabPath);
- storage_monitor_->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 StorageMonitorLinux.
- 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)
+ storage_monitor_->Init();
+#endif
ChromeBrowserMainPartsPosix::PostProfileInit();
}
@@ -170,7 +148,5 @@ void ChromeBrowserMainPartsLinux::PostMainMessageLoopRun() {
storage_monitor_ = NULL;
#endif
- media_transfer_protocol_device_observer_.reset();
-
ChromeBrowserMainPartsPosix::PostMainMessageLoopRun();
}
« no previous file with comments | « chrome/browser/chrome_browser_main_linux.h ('k') | chrome/browser/chrome_browser_main_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698