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

Side by Side Diff: components/arc/standalone/service_helper.h

Issue 2384173004: arc: Remove components/arc/standalone (Closed)
Patch Set: Rebased to ToT Created 4 years, 2 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 2016 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 COMPONENTS_ARC_STANDALONE_SERVICE_HELPER_H_
6 #define COMPONENTS_ARC_STANDALONE_SERVICE_HELPER_H_
7
8 #include <signal.h>
9
10 #include <memory>
11
12 #include "base/files/file_descriptor_watcher_posix.h"
13 #include "base/files/scoped_file.h"
14
15 namespace arc {
16
17 // Helper class to set up service-like processes.
18 class ServiceHelper {
19 public:
20 ServiceHelper();
21 ~ServiceHelper();
22
23 // Must be called after message loop instantiation.
24 void Init(const base::Closure& closure);
25
26 private:
27 void OnFileCanReadWithoutBlocking();
28
29 static void TerminationHandler(int /* signum */);
30
31 // Static variable to guarantee instantiated only once per process.
32 static ServiceHelper* self_;
33
34 base::Closure closure_;
35 base::ScopedFD read_fd_;
36 base::ScopedFD write_fd_;
37 std::unique_ptr<base::FileDescriptorWatcher::Controller> watch_controller_;
38 struct sigaction old_sigint_;
39 struct sigaction old_sigterm_;
40
41 DISALLOW_COPY_AND_ASSIGN(ServiceHelper);
42 };
43
44 } // namespace arc
45
46 #endif // COMPONENTS_ARC_STANDALONE_SERVICE_HELPER_H_
OLDNEW
« no previous file with comments | « components/arc/standalone/arc_standalone_bridge_runner.cc ('k') | components/arc/standalone/service_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698