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

Unified Diff: content/browser/device_orientation/device_motion_provider.cc

Issue 18572014: Implement Android shared memory data fetcher for Device Motion. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@renderer-sync-12June-tryASYNC-2-bis-tryRebase-6
Patch Set: rebased Created 7 years, 5 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_orientation/device_motion_provider.cc
diff --git a/content/browser/device_orientation/device_motion_provider.cc b/content/browser/device_orientation/device_motion_provider.cc
index 761f111be07f684035055ccdc9f37a13079190a5..84f65cabd1108b6da4bec2a79ff06275a13788a1 100644
--- a/content/browser/device_orientation/device_motion_provider.cc
+++ b/content/browser/device_orientation/device_motion_provider.cc
@@ -2,8 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/logging.h"
#include "content/browser/device_orientation/device_motion_provider.h"
+
+#include "base/logging.h"
+#include "content/browser/device_orientation/data_fetcher_shared_memory.h"
#include "content/common/device_motion_hardware_buffer.h"
namespace content {
@@ -31,13 +33,15 @@ base::SharedMemoryHandle DeviceMotionProvider::GetSharedMemoryHandleForProcess(
void DeviceMotionProvider::StartFetchingDeviceMotionData() {
if (is_started_)
return;
- // TODO(timvolodine): call data_fetcher_->StartFetchingDeviceMotionData(
- // SharedMemoryAsHardwareBuffer());
+ if (!data_fetcher_)
+ data_fetcher_.reset(new DataFetcherSharedMemory);
+ data_fetcher_->StartFetchingDeviceMotionData(SharedMemoryAsHardwareBuffer());
is_started_ = true;
}
void DeviceMotionProvider::StopFetchingDeviceMotionData() {
- // TODO(timvolodine): call data_fetcher_->StopFetchingDeviceMotionData();
+ if (data_fetcher_)
+ data_fetcher_->StopFetchingDeviceMotionData();
is_started_ = false;
}
« no previous file with comments | « content/browser/device_orientation/device_motion_provider.h ('k') | content/browser/device_orientation/provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698