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

Side by Side Diff: content/browser/device_orientation/data_fetcher_platform.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: added OWNERS file 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 "base/logging.h"
6 #include "data_fetcher_platform.h"
7
8 namespace content {
9
10 SharedMemoryPlatformDataFetcherEmpty::SharedMemoryPlatformDataFetcherEmpty()
11 : device_motion_buffer_(0) {
bulach 2013/07/04 08:23:36 nit: NULL
timvolodine 2013/07/04 12:02:52 Done.
12 }
13
14 SharedMemoryPlatformDataFetcherEmpty*
15 SharedMemoryPlatformDataFetcherEmpty::instance() {
16 CR_DEFINE_STATIC_LOCAL(SharedMemoryPlatformDataFetcherEmpty,
17 s_data_fetcher, ());
18 return &s_data_fetcher;
19 }
20
21 bool SharedMemoryPlatformDataFetcherEmpty::NeedsPolling() {
22 return false;
23 }
24
25 bool SharedMemoryPlatformDataFetcherEmpty::FetchDeviceMotionDataIntoBuffer() {
26 DCHECK(NeedsPolling());
27 return false;
28 }
29
30 bool SharedMemoryPlatformDataFetcherEmpty::StartFetchingDeviceMotionData(
31 DeviceMotionHardwareBuffer* buffer) {
32 DCHECK(buffer);
33 device_motion_buffer_->seqlock.WriteBegin();
34 device_motion_buffer_->data.allAvailableSensorsAreActive = true;
35 device_motion_buffer_->seqlock.WriteEnd();
36 return true;
37 }
38
39 void SharedMemoryPlatformDataFetcherEmpty::StopFetchingDeviceMotionData() {
40 device_motion_buffer_->seqlock.WriteBegin();
41 device_motion_buffer_->data.allAvailableSensorsAreActive = false;
42 device_motion_buffer_->seqlock.WriteEnd();
43 }
44
45 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698