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

Side by Side Diff: tools/android/forwarder2/daemon.h

Issue 11269036: Support HTTP test-server based net unit tests on Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Clang build + sync Created 8 years, 1 month 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) 2012 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 TOOLS_ANDROID_FORWARDER2_DAEMON_H_
6 #define TOOLS_ANDROID_FORWARDER2_DAEMON_H_
7
8 #include <string>
9
10 #include "base/at_exit.h"
11 #include "base/basictypes.h"
12
13 namespace forwarder2 {
14
15 class Daemon {
16 public:
17 // |pid_file_path| is the file path to which the daemon's PID will be written.
18 // Note that a lock on the file is also acquired to guarantee that a single
19 // instance of daemon is running.
20 explicit Daemon(const std::string& pid_file_path);
21
22 // Returns whether the daemon was successfully spawned. Use |is_daemon| to
23 // distinguish the parent from the child (daemon) process.
24 bool Spawn(bool* is_daemon);
25
26 // Kills the daemon and blocks until it exited.
27 bool Kill();
28
29 private:
30 const std::string pid_file_path_;
31 base::AtExitManager at_exit_manager;
32
33 DISALLOW_COPY_AND_ASSIGN(Daemon);
34 };
35
36 } // namespace forwarder2
37
38 #endif // TOOLS_ANDROID_FORWARDER2_DAEMON_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698