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

Unified Diff: device/media_transfer_protocol/media_transfer_protocol_manager.cc

Issue 57333002: ChromeOS: Accept NULL SystemBus in MediaTransferProtocolManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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_daemon_client.cc ('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
diff --git a/device/media_transfer_protocol/media_transfer_protocol_manager.cc b/device/media_transfer_protocol/media_transfer_protocol_manager.cc
index 6c0210af1e0613f64439b24237f424642671f8dc..2b20296756a642b0c028e09665ba41951f5fc086 100644
--- a/device/media_transfer_protocol/media_transfer_protocol_manager.cc
+++ b/device/media_transfer_protocol/media_transfer_protocol_manager.cc
@@ -50,16 +50,18 @@ class MediaTransferProtocolManagerImpl : public MediaTransferProtocolManager {
session_bus_ = new dbus::Bus(options);
#endif
- // Listen for future mtpd service owner changes, in case it is not
- // available right now. There is no guarantee on Linux or ChromeOS that
- // mtpd is running already.
- mtpd_owner_changed_callback_ =
- base::Bind(&MediaTransferProtocolManagerImpl::FinishSetupOnOriginThread,
- weak_ptr_factory_.GetWeakPtr());
- GetBus()->ListenForServiceOwnerChange(mtpd::kMtpdServiceName,
- mtpd_owner_changed_callback_);
- GetBus()->GetServiceOwner(mtpd::kMtpdServiceName,
- mtpd_owner_changed_callback_);
+ if (GetBus()) {
+ // Listen for future mtpd service owner changes, in case it is not
+ // available right now. There is no guarantee on Linux or ChromeOS that
+ // mtpd is running already.
+ mtpd_owner_changed_callback_ = base::Bind(
+ &MediaTransferProtocolManagerImpl::FinishSetupOnOriginThread,
+ weak_ptr_factory_.GetWeakPtr());
+ GetBus()->ListenForServiceOwnerChange(mtpd::kMtpdServiceName,
+ mtpd_owner_changed_callback_);
+ GetBus()->GetServiceOwner(mtpd::kMtpdServiceName,
+ mtpd_owner_changed_callback_);
+ }
}
virtual ~MediaTransferProtocolManagerImpl() {
@@ -428,9 +430,7 @@ class MediaTransferProtocolManagerImpl : public MediaTransferProtocolManager {
current_mtpd_owner_ = mtpd_service_owner;
- mtp_client_.reset(
- MediaTransferProtocolDaemonClient::Create(GetBus(),
- false /* not stub */));
+ mtp_client_.reset(MediaTransferProtocolDaemonClient::Create(GetBus()));
// Set up signals and start initializing |storage_info_map_|.
mtp_client_->SetUpConnections(
« no previous file with comments | « device/media_transfer_protocol/media_transfer_protocol_daemon_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698