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

Side by Side Diff: athena/system/device_socket_listener.h

Issue 431183003: Rotate screen in response to accelerator or device orientation sensors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
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 #ifndef ATHENA_SYSTEM_DEVICE_SOCKET_LISTENER_H_
6 #define ATHENA_SYSTEM_DEVICE_SOCKET_LISTENER_H_
7
8 #include <string>
9
10 #include "base/basictypes.h"
11
12 namespace athena {
13
14 // This class reads device-data from a socket.
15 class DeviceSocketListener {
16 public:
17 DeviceSocketListener(const std::string& socket_parth,
18 size_t data_size);
19 virtual ~DeviceSocketListener();
20
21 // This is called on the IO thread when data is available on the socket.
22 // |data| is guaranteed to be of exactly |data_size| length. Note that the
23 // implementation must not mutate or free the data.
24 virtual void OnDataAvailableOnIO(const void* data) = 0;
25
26 protected:
27 void StartListening();
28 void StopListening();
29
30 private:
31 const std::string socket_path_;
32 size_t data_size_;
33
34 DISALLOW_COPY_AND_ASSIGN(DeviceSocketListener);
35 };
36
37 } // namespace athena
38
39 #endif // ATHENA_SYSTEM_DEVICE_SOCKET_LISTENER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698