Reland: Introduce MTP Mojo interface talking to MediaTransferProtocolManager.
The original CL has been reverted because it caused a crash on start up.
In previous CL, MediaTransferProtocolManager was built as a static library
which was depended by both component::StorageMonitor(a static library),
and device::mojom::MtpManager which will be included in "content" shared
library for component build. So the singleton MediaTransferProtocolManager
instance actually was not identical in two places as the shared library
would keep a copy in its own package which caused the crash.
This reland CL build the MediaTransferProtocolManager as a "component" to
keep the singleton instance identical for component build.
The original CL's description:
> This CL:
> 1) introduces 2 Mojo interfaces device::mojom::MtpManager and
> device::mojom::MtpManagerClient which expose MTP device accessing
> by forwarding invokes to existing MediaTransferProtocolManager.
> 2) makes Device Service expose the above 2 Mojo interfaces.
> 3) create stubs to connect these 2 interfaces with the main user
> component::StorageMonitor.
> More Mojo methods will be added to MtpManager and all users will be
> converted to use Mojo interfaces in the succeeding CLs.
> BUG=769630
> Change-Id: I4680de2b9307cd40fb660c8e115e03f08cd3da10
Change-Id: I4680de2b9307cd40fb660c8e115e03f08cd3da10
Reviewed-on: https://chromium-review.googlesource.com/1014576
Reviewed-by: Lei Zhang <[email protected]>
Reviewed-by: Tom Sepez <[email protected]>
Reviewed-by: Devlin <[email protected]>
Reviewed-by: Scott Violet <[email protected]>
Reviewed-by: Colin Blundell <[email protected]>
Commit-Queue: Donna Wu <[email protected]>
Cr-Commit-Position: refs/heads/master@{#552274}
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index b447597..b0e4cda 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -125,6 +125,7 @@
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/network_connection_tracker.h"
+#include "content/public/common/service_manager_connection.h"
#include "extensions/buildflags/buildflags.h"
#include "extensions/common/constants.h"
#include "media/media_buildflags.h"
@@ -1160,7 +1161,10 @@
#endif // BUILDFLAG(ENABLE_PLUGINS)
#if !defined(OS_ANDROID)
- storage_monitor::StorageMonitor::Create();
+ storage_monitor::StorageMonitor::Create(
+ content::ServiceManagerConnection::GetForProcess()
+ ->GetConnector()
+ ->Clone());
#endif
child_process_watcher_ = std::make_unique<ChromeChildProcessWatcher>();