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

Side by Side Diff: content/browser/device_orientation/data_fetcher_shared_memory_default.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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "data_fetcher_shared_memory.h"
6
7 #include "base/logging.h"
8
9 namespace content {
10
11 DataFetcherSharedMemory::~DataFetcherSharedMemory() {
12 StopFetchingDeviceMotionData();
13 }
14
15 bool DataFetcherSharedMemory::NeedsPolling() {
16 return false;
17 }
18
19 bool DataFetcherSharedMemory::FetchDeviceMotionDataIntoBuffer() {
20 NOTREACHED();
21 return false;
22 }
23
24 bool DataFetcherSharedMemory::StartFetchingDeviceMotionData(
25 DeviceMotionHardwareBuffer* buffer) {
26 DCHECK(buffer);
27 device_motion_buffer_->seqlock.WriteBegin();
28 device_motion_buffer_->data.allAvailableSensorsAreActive = true;
29 device_motion_buffer_->seqlock.WriteEnd();
30 return true;
31 }
32
33 void DataFetcherSharedMemory::StopFetchingDeviceMotionData() {
34 device_motion_buffer_->seqlock.WriteBegin();
35 device_motion_buffer_->data.allAvailableSensorsAreActive = false;
36 device_motion_buffer_->seqlock.WriteEnd();
37 }
38
39 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698