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

Side by Side Diff: remoting/host/plugin/host_script_object.h

Issue 9316078: Added daemon process NPAPI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Separated out Start/SetPin and added return codes to Stop and Start. Created 8 years, 10 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef REMOTING_HOST_PLUGIN_HOST_SCRIPT_OBJECT_H_ 5 #ifndef REMOTING_HOST_PLUGIN_HOST_SCRIPT_OBJECT_H_
6 #define REMOTING_HOST_PLUGIN_HOST_SCRIPT_OBJECT_H_ 6 #define REMOTING_HOST_PLUGIN_HOST_SCRIPT_OBJECT_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 13 matching lines...) Expand all
24 #include "remoting/host/log_to_server.h" 24 #include "remoting/host/log_to_server.h"
25 #include "remoting/host/plugin/host_plugin_utils.h" 25 #include "remoting/host/plugin/host_plugin_utils.h"
26 #include "remoting/host/ui_strings.h" 26 #include "remoting/host/ui_strings.h"
27 #include "third_party/npapi/bindings/npapi.h" 27 #include "third_party/npapi/bindings/npapi.h"
28 #include "third_party/npapi/bindings/npfunctions.h" 28 #include "third_party/npapi/bindings/npfunctions.h"
29 #include "third_party/npapi/bindings/npruntime.h" 29 #include "third_party/npapi/bindings/npruntime.h"
30 30
31 namespace remoting { 31 namespace remoting {
32 32
33 class ChromotingHost; 33 class ChromotingHost;
34 class DaemonController;
34 class DesktopEnvironment; 35 class DesktopEnvironment;
35 class It2MeHostUserInterface; 36 class It2MeHostUserInterface;
36 class MutableHostConfig; 37 class MutableHostConfig;
37 class RegisterSupportHostRequest; 38 class RegisterSupportHostRequest;
38 class SignalStrategy; 39 class SignalStrategy;
39 class SupportAccessVerifier; 40 class SupportAccessVerifier;
40 41
41 namespace policy_hack { 42 namespace policy_hack {
42 class NatPolicy; 43 class NatPolicy;
43 } // namespace policy_hack 44 } // namespace policy_hack
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 100
100 // Disconnect. No arguments or result. 101 // Disconnect. No arguments or result.
101 bool Disconnect(const NPVariant* args, uint32_t argCount, NPVariant* result); 102 bool Disconnect(const NPVariant* args, uint32_t argCount, NPVariant* result);
102 103
103 // Localize strings. args are: 104 // Localize strings. args are:
104 // localize_func - a callback function which returns a localized string for 105 // localize_func - a callback function which returns a localized string for
105 // a given tag name. 106 // a given tag name.
106 // No result. 107 // No result.
107 bool Localize(const NPVariant* args, uint32_t argCount, NPVariant* result); 108 bool Localize(const NPVariant* args, uint32_t argCount, NPVariant* result);
108 109
110 // Set the PIN for Me2Me. Args are:
111 // string pin
112 // Returns true if the PIN was updated successfully.
113 bool SetDaemonPin(const NPVariant* args, uint32_t argCount,
114 NPVariant* result);
115
116 // Start the daemon process or change the PIN if it is running. No args.
117 // Returns true if the download/start mechanism was initiated successfully
118 // (poll daemonState to wait for completion) or false if an error occurred.
119 bool StartDaemon(const NPVariant* args, uint32_t argCount, NPVariant* result);
120
121 // Start the daemon process or change the PIN if it is running. No arguments.
122 // Returns true if the daemon was stopped successfully or false on error.
123 bool StopDaemon(const NPVariant* args, uint32_t argCount, NPVariant* result);
124
109 // Updates state of the host. Can be called only on the main thread. 125 // Updates state of the host. Can be called only on the main thread.
110 void SetState(State state); 126 void SetState(State state);
111 127
112 // Notifies OnStateChanged handler of a state change. 128 // Notifies OnStateChanged handler of a state change.
113 void NotifyStateChanged(State state); 129 void NotifyStateChanged(State state);
114 130
115 // Call LogDebugInfo handler if there is one. 131 // Call LogDebugInfo handler if there is one.
116 // This must be called on the correct thread. 132 // This must be called on the correct thread.
117 void LogDebugInfo(const std::string& message); 133 void LogDebugInfo(const std::string& message);
118 134
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 scoped_ptr<LogToServer> log_to_server_; 201 scoped_ptr<LogToServer> log_to_server_;
186 scoped_ptr<DesktopEnvironment> desktop_environment_; 202 scoped_ptr<DesktopEnvironment> desktop_environment_;
187 scoped_ptr<It2MeHostUserInterface> it2me_host_user_interface_; 203 scoped_ptr<It2MeHostUserInterface> it2me_host_user_interface_;
188 204
189 scoped_refptr<ChromotingHost> host_; 205 scoped_refptr<ChromotingHost> host_;
190 int failed_login_attempts_; 206 int failed_login_attempts_;
191 207
192 UiStrings ui_strings_; 208 UiStrings ui_strings_;
193 base::Lock ui_strings_lock_; 209 base::Lock ui_strings_lock_;
194 210
211 scoped_ptr<DaemonController> daemon_controller_;
212
195 base::WaitableEvent disconnected_event_; 213 base::WaitableEvent disconnected_event_;
196 214
197 // True if we're in the middle of handling a log message. 215 // True if we're in the middle of handling a log message.
198 bool am_currently_logging_; 216 bool am_currently_logging_;
199 217
200 base::Lock nat_policy_lock_; 218 base::Lock nat_policy_lock_;
201 219
202 scoped_ptr<policy_hack::NatPolicy> nat_policy_; 220 scoped_ptr<policy_hack::NatPolicy> nat_policy_;
203 221
204 // Host the current nat traversal policy setting. 222 // Host the current nat traversal policy setting.
205 bool nat_traversal_enabled_; 223 bool nat_traversal_enabled_;
206 224
207 // Indicates whether or not a policy has ever been read. This is to ensure 225 // Indicates whether or not a policy has ever been read. This is to ensure
208 // that on startup, we do not accidentally start a connection before we have 226 // that on startup, we do not accidentally start a connection before we have
209 // queried our policy restrictions. 227 // queried our policy restrictions.
210 bool policy_received_; 228 bool policy_received_;
211 229
212 // On startup, it is possible to have Connect() called before the policy read 230 // On startup, it is possible to have Connect() called before the policy read
213 // is completed. Rather than just failing, we thunk the connection call so 231 // is completed. Rather than just failing, we thunk the connection call so
214 // it can be executed after at least one successful policy read. This 232 // it can be executed after at least one successful policy read. This
215 // variable contains the thunk if it is necessary. 233 // variable contains the thunk if it is necessary.
216 base::Closure pending_connect_; 234 base::Closure pending_connect_;
217 }; 235 };
218 236
219 } // namespace remoting 237 } // namespace remoting
220 238
221 #endif // REMOTING_HOST_PLUGIN_HOST_SCRIPT_OBJECT_H_ 239 #endif // REMOTING_HOST_PLUGIN_HOST_SCRIPT_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698