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

Side by Side Diff: content/browser/device_orientation/data_fetcher_shared_memory_android.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 comments, added proper singleton implementation and shutdown. 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_impl_android.h"
7 #include "data_fetcher_shared_memory.h"
8
9 namespace content {
10
11 DataFetcherSharedMemory::~DataFetcherSharedMemory() {
12 NOTREACHED();
13 }
14
15 DataFetcherSharedMemory*
16 DataFetcherSharedMemory::instance() {
17 CR_DEFINE_STATIC_LOCAL(DataFetcherSharedMemory,
18 s_data_fetcher_android, ());
19 return &s_data_fetcher_android;
20 }
21
22 bool DataFetcherSharedMemory::NeedsPolling() {
23 return DataFetcherImplAndroid::GetInstance()->NeedsPolling();
24 }
25
26 bool DataFetcherSharedMemory::FetchDeviceMotionDataIntoBuffer() {
27 return DataFetcherImplAndroid::GetInstance()->
28 FetchDeviceMotionDataIntoBuffer();
29 }
30
31 bool DataFetcherSharedMemory::StartFetchingDeviceMotionData(
32 DeviceMotionHardwareBuffer* buffer) {
33 device_motion_buffer_ = buffer;
34 return DataFetcherImplAndroid::GetInstance()->
35 StartFetchingDeviceMotionData(buffer);
36 }
37
38 void DataFetcherSharedMemory::StopFetchingDeviceMotionData() {
39 DataFetcherImplAndroid::GetInstance()->StopFetchingDeviceMotionData();
40 }
41
42 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698