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

Unified Diff: services/device/device_service.cc

Issue 2730333002: Make DeviceSensorService implement MainLoop::DestructionObserver (Closed)
Patch Set: Make DeviceSensorService observes IOThread to shutdown in right time. Created 3 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
« device/sensors/device_sensor_service.cc ('K') | « services/device/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/device/device_service.cc
diff --git a/services/device/device_service.cc b/services/device/device_service.cc
index 0044460a1d9c1dd4bb4d99313ae24f2582b861bb..04287e32bd05aba7530f8ced32a575fcefb8b3ea 100644
--- a/services/device/device_service.cc
+++ b/services/device/device_service.cc
@@ -15,6 +15,8 @@
#include "services/service_manager/public/cpp/interface_registry.h"
#if defined(OS_ANDROID)
+#include "base/trace_event/trace_event.h"
+#include "device/sensors/device_sensor_service.h"
#include "services/device/android/register_jni.h"
#endif
@@ -36,7 +38,12 @@ DeviceService::DeviceService(
scoped_refptr<base::SingleThreadTaskRunner> file_task_runner)
: file_task_runner_(std::move(file_task_runner)) {}
-DeviceService::~DeviceService() {}
+DeviceService::~DeviceService() {
+#if defined(OS_ANDROID)
+ TRACE_EVENT0("shutdown", "DeviceService::Subsystem:SensorService");
ke.he 2017/03/08 09:19:55 For Android platform, it is safe to shutdown in UI
blundell 2017/03/08 17:38:17 Do you think that we could just use the same mecha
ke.he 2017/03/09 02:37:33 For Android platform, DeviceSensorService runs in
+ device::DeviceSensorService::GetInstance()->Shutdown();
+#endif
+}
void DeviceService::OnStart() {}
« device/sensors/device_sensor_service.cc ('K') | « services/device/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698