OLD | NEW |
---|---|
(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 REMOTING_DAEMON_NPAPI_H_ | |
Sergey Ulanov
2012/02/02 23:41:24
nit: REMOTING_HOST_PLUGIN_DAEMONG_NPAPI_H_
Jamie
2012/02/03 00:47:41
Done.
| |
6 #define REMOTING_DAEMON_NPAPI_H_ | |
7 | |
8 namespace remoting { | |
9 | |
10 class DaemonNpapi { | |
Sergey Ulanov
2012/02/02 23:41:24
Not sure if this is a right name for this class -
Jamie
2012/02/03 00:47:41
Done.
Wez
2012/02/03 01:25:36
Agreed.
| |
11 public: | |
12 virtual ~DaemonNpapi() {} | |
13 | |
14 enum State { | |
Sergey Ulanov
2012/02/02 23:41:24
nit: This should be declared before the constructo
Jamie
2012/02/03 00:47:41
I think it's clearer placed next to where it's use
| |
15 // The daemon process is not installed. This is functionally equivalent | |
16 // to STATE_STOPPED, but the start method is expected to be significantly | |
17 // slower, and might involve user interaction. It might be appropriate to | |
18 // indicate this in the UI. | |
19 STATE_NOT_INSTALLED = 0, | |
Wez
2012/02/03 01:25:36
nit: Do we need explicit values for each enum valu
Jamie
2012/02/03 01:40:15
When the JS side of this is implemented, we'll nee
| |
20 // The daemon process is installed but not running. Call Start to start it. | |
21 STATE_STOPPED = 1, | |
22 // The daemon process is running. Call Start again to change the PIN or | |
23 // Stop to stop it. | |
24 STATE_STARTED = 2, | |
25 // The previous Start operation failed. This is functionally equivalent | |
26 // to STATE_STOPPED, but the UI should report an error in this state. | |
27 // This state should not persist across restarts of the NPAPI process. | |
28 STATE_START_FAILED = 3 | |
Wez
2012/02/03 01:25:36
Perhaps have a STATE_NOT_IMPLEMENTED for now, for
Jamie
2012/02/03 01:40:15
Good idea. Done.
| |
29 }; | |
30 | |
31 // Return the state of the daemon process. | |
32 virtual State GetState() = 0; | |
33 | |
34 // Start the daemon process and set the PIN, which should be expressed as a | |
35 // UTF8-encoded string. Since this may require that the daemon be downloaded | |
36 // and installed, this may take a long time--poll GetState until the state is | |
37 // STATE_STARTED or STATE_START_FAILED. | |
38 // | |
39 // Calling Start when the daemon is already running changes the PIN. | |
40 virtual void Start(const char* pin) = 0; | |
alexeypa (please no reviews)
2012/02/03 00:26:05
nit: typically it is pretty bad idea to pass a str
Jamie
2012/02/03 00:47:41
Both seem reasonably common in Chrome. I prefer co
Sergey Ulanov
2012/02/03 01:08:24
Chromoting uses string class in most cases, and I
Wez
2012/02/03 01:25:36
Why do we want to set the PIN when we start the Da
Wez
2012/02/03 01:25:36
Surely wrapping it as std::string doesn't help - i
Jamie
2012/02/03 01:40:15
According to the latest mocks, you can't start the
| |
41 | |
42 // Stop the daemon process. It is permitted to call Stop while the daemon | |
43 // process is being installed, in which case the installation should be | |
44 // aborted if possible; if not then it is sufficient to ensure that the | |
45 // daemon process is not started automatically upon successful installation. | |
46 virtual void Stop() = 0; | |
47 | |
48 static DaemonNpapi* Create(); | |
49 }; | |
50 | |
51 } // namespace remoting | |
52 | |
53 #endif | |
Sergey Ulanov
2012/02/02 23:41:24
nit: // REMOTING_...
Jamie
2012/02/03 00:47:41
Done.
| |
OLD | NEW |