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

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: fixed some includes 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_shared_memory.h"
7
8 namespace content {
9
10 DataFetcherSharedMemory::~DataFetcherSharedMemory() {
11 }
12
13 DataFetcherSharedMemory*
14 DataFetcherSharedMemory::instance() {
15 CR_DEFINE_STATIC_LOCAL(SharedMemoryPlatformDataFetcherEmpty,
16 s_data_fetcher, ());
17 return &s_data_fetcher;
18 }
19
20 bool DataFetcherSharedMemory::NeedsPolling() {
21 return false;
22 }
23
24 bool DataFetcherSharedMemory::FetchDeviceMotionDataIntoBuffer() {
25 DCHECK(NeedsPolling());
bulach 2013/07/09 09:03:29 nit: NOTREACHED() ?
timvolodine 2013/07/09 18:59:56 Done.
26 return false;
27 }
28
29 bool DataFetcherSharedMemory::StartFetchingDeviceMotionData(
30 DeviceMotionHardwareBuffer* buffer) {
31 DCHECK(buffer);
32 device_motion_buffer_->seqlock.WriteBegin();
33 device_motion_buffer_->data.allAvailableSensorsAreActive = true;
34 device_motion_buffer_->seqlock.WriteEnd();
35 return true;
36 }
37
38 void DataFetcherSharedMemory::StopFetchingDeviceMotionData() {
39 device_motion_buffer_->seqlock.WriteBegin();
40 device_motion_buffer_->data.allAvailableSensorsAreActive = false;
41 device_motion_buffer_->seqlock.WriteEnd();
42 }
43
44 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698