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

Unified Diff: content/browser/device_sensors/device_sensor_service.h

Issue 2410123002: Remove content::BrowserThread knowledge from Device Sensors (Closed)
Patch Set: Rebase, avoid object creation on startup Created 4 years, 2 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: content/browser/device_sensors/device_sensor_service.h
diff --git a/content/browser/device_sensors/device_sensor_service.h b/content/browser/device_sensors/device_sensor_service.h
index 00946b484ae160a329029147e4255bf3a4dd2d63..424f2706a24852da3b7f0ef54d76cbb1e02b50cf 100644
--- a/content/browser/device_sensors/device_sensor_service.h
+++ b/content/browser/device_sensors/device_sensor_service.h
@@ -30,19 +30,20 @@ class CONTENT_EXPORT DeviceSensorService {
// Increments the number of users of the provider. The Provider is running
// when there's > 0 users, and is paused when the count drops to 0.
- // Must be called on the I/O thread.
+ // Must be called on a thread that can perform I/O.
void AddConsumer(ConsumerType consumer_type);
// Removes a consumer. Should be matched with an AddConsumer call.
- // Must be called on the I/O thread.
+ // Must be called on a thread that can perform I/O.
void RemoveConsumer(ConsumerType cosumer_type);
// Returns the shared memory handle of the device motion data.
mojo::ScopedSharedBufferHandle GetSharedMemoryHandle(
ConsumerType consumer_type);
- // Stop/join with the background polling thread in |provider_|.
- void Shutdown();
+ // Stop/join with the background polling thread in |provider_|. Must be
+ // called on the UI thread.
+ void ShutDownOnUIThread();
// Injects a custom data fetcher for testing purposes. This class takes
// ownership of the injected object.
@@ -63,7 +64,9 @@ class CONTENT_EXPORT DeviceSensorService {
int num_orientation_absolute_readers_;
bool is_shutdown_;
std::unique_ptr<DataFetcherSharedMemory> data_fetcher_;
- base::ThreadChecker thread_checker_;
+
+ // Associated with the IO thread.
+ base::ThreadChecker io_thread_checker_;
DISALLOW_COPY_AND_ASSIGN(DeviceSensorService);
};
« no previous file with comments | « content/browser/device_sensors/device_sensor_host.cc ('k') | content/browser/device_sensors/device_sensor_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698