diff options
author | timvolodine@chromium.org <timvolodine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-22 13:02:00 +0000 |
---|---|---|
committer | timvolodine@chromium.org <timvolodine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-22 13:02:00 +0000 |
commit | 436c24cdedc0df0b046885a62f0f307b72a3dbef (patch) | |
tree | df8805925daf15228b719ba3912331802e1cb29a /content/browser/browser_main_loop.cc | |
parent | 4baca78ffb267c1538b46ec07bc386b009133133 (diff) | |
download | chromium_src-436c24cdedc0df0b046885a62f0f307b72a3dbef.zip chromium_src-436c24cdedc0df0b046885a62f0f307b72a3dbef.tar.gz chromium_src-436c24cdedc0df0b046885a62f0f307b72a3dbef.tar.bz2 |
Implement inertial sensor service and shared memory data fetcher for device motion/orientation.
This CL modifies the existing structure by introducing a more general approach using enums for representing consumers of motion/orientation data.
There is now a singleton service class which owns the shared memory data fetcher. The shared memory data fetcher takes care of updating the shared memory buffer with fresh sensor data. On some platforms like mac this needs a polling thread, on others like Android the data is pushed by the system. This logic is encapsulated inside the data fetcher, so there is now no need for a separate provider class.
In particular this CL includes:
- generalized inertial_sensor_service class with support for both motion/orientation consumers,
- generalized data_fetcher_shared_memory_base class which takes care of initialization and polling if needed,
- android data fetcher and default data fetcher (only for motion for now).
- enums for orientation/motion, for optimal code reuse,
- unittests for data_fetcher_shared_memory_base for both motion and orientation.
BUG=261165,269559
Review URL: https://chromiumcodereview.appspot.com/21735007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@219007 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/browser_main_loop.cc')
-rw-r--r-- | content/browser/browser_main_loop.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc index 82a312e8..8bf6503 100644 --- a/content/browser/browser_main_loop.cc +++ b/content/browser/browser_main_loop.cc @@ -23,7 +23,7 @@ #include "base/threading/thread_restrictions.h" #include "base/timer/hi_res_timer_manager.h" #include "content/browser/browser_thread_impl.h" -#include "content/browser/device_orientation/device_motion_service.h" +#include "content/browser/device_orientation/device_inertial_sensor_service.h" #include "content/browser/download/save_file_manager.h" #include "content/browser/gamepad/gamepad_service.h" #include "content/browser/gpu/browser_gpu_channel_host_factory.h" @@ -796,7 +796,7 @@ void BrowserMainLoop::ShutdownThreadsAndCleanUp() { // Must happen after the I/O thread is shutdown since this class lives on the // I/O thread and isn't threadsafe. GamepadService::GetInstance()->Terminate(); - DeviceMotionService::GetInstance()->Shutdown(); + DeviceInertialSensorService::GetInstance()->Shutdown(); URLDataManager::DeleteDataSources(); #endif // !defined(OS_IOS) |