summaryrefslogtreecommitdiffstats
path: root/chrome/service/service_process.h
diff options
context:
space:
mode:
authorglen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-10 02:46:54 +0000
committerglen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-10 02:46:54 +0000
commit71eb23d453937c320f1c7a3f46c1aae335df6269 (patch)
tree6c13ed9a14c68b4bfda90c26fce9b03b1327c79d /chrome/service/service_process.h
parent53d23fcc886d2a412cd8aaeb45c3c60f0586093c (diff)
downloadchromium_src-71eb23d453937c320f1c7a3f46c1aae335df6269.zip
chromium_src-71eb23d453937c320f1c7a3f46c1aae335df6269.tar.gz
chromium_src-71eb23d453937c320f1c7a3f46c1aae335df6269.tar.bz2
Revert 55507 - Start chromoting host in the service process though a method call
This change exposes method calls to configure the chromoting host and allow it to be started from a method. This will allow us to use IPC message to start the chromoting host. TEST=unit_tests --gtest_filter=ServiceProcess* BUG=50243, 50244 Review URL: http://codereview.chromium.org/3084024 TBR=hclam@chromium.org Review URL: http://codereview.chromium.org/3110004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55525 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/service/service_process.h')
-rw-r--r--chrome/service/service_process.h50
1 files changed, 6 insertions, 44 deletions
diff --git a/chrome/service/service_process.h b/chrome/service/service_process.h
index 599fa00..ce476c6 100644
--- a/chrome/service/service_process.h
+++ b/chrome/service/service_process.h
@@ -6,7 +6,6 @@
#define CHROME_SERVICE_SERVICE_PROCESS_H_
#pragma once
-#include "base/gtest_prod_util.h"
#include "base/ref_counted.h"
#include "base/scoped_ptr.h"
#include "base/thread.h"
@@ -22,7 +21,7 @@ class NetworkChangeNotifier;
namespace remoting {
class ChromotingHost;
class ChromotingHostContext;
-class JsonHostConfig;
+class MutableHostConfig;
}
// The ServiceProcess does not inherit from ChildProcess because this
@@ -32,8 +31,7 @@ class ServiceProcess {
ServiceProcess();
~ServiceProcess();
- // Initialize the ServiceProcess with the message loop that it should run on.
- bool Initialize(MessageLoop* message_loop);
+ bool Initialize();
bool Teardown();
// TODO(sanjeevr): Change various parts of the code such as
// net::ProxyService::CreateSystemProxyConfigService to take in
@@ -66,62 +64,26 @@ class ServiceProcess {
}
CloudPrintProxy* GetCloudPrintProxy();
-
#if defined(ENABLE_REMOTING)
- // Return the reference to the chromoting host only if it has started.
- remoting::ChromotingHost* GetChromotingHost() { return chromoting_host_; }
-
- // Start running the chromoting host asynchronously.
- // Return true if chromoting host has started.
- bool StartChromotingHost();
-
- // Shutdown chromoting host. Return true if chromoting host was shutdown.
- // The shutdown process will happen asynchronously.
- bool ShutdownChromotingHost();
+ remoting::ChromotingHost* CreateChromotingHost(
+ remoting::ChromotingHostContext* context,
+ remoting::MutableHostConfig* config);
#endif
private:
-#if defined(ENABLE_REMOTING)
- FRIEND_TEST(ServiceProcessTest, RunChromoting);
- FRIEND_TEST_ALL_PREFIXES(ServiceProcessTest, RunChromotingUntilShutdown);
-
- // Save authenication token to the json config file.
- void SaveChromotingConfig(
- const std::string& login,
- const std::string& token,
- const std::string& host_id,
- const std::string& host_name,
- const std::string& private_key);
-
- // Load settings for chromoting from json file.
- void LoadChromotingConfig();
-
- // This method is called when chromoting is shutting down. This is virtual
- // for used in the test.
- virtual void OnChromotingHostShutdown();
-#endif
-
scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_;
scoped_ptr<base::Thread> io_thread_;
scoped_ptr<base::Thread> file_thread_;
scoped_ptr<CloudPrintProxy> cloud_print_proxy_;
scoped_ptr<JsonPrefStore> service_prefs_;
scoped_ptr<ServiceIPCServer> ipc_server_;
-
-#if defined(ENABLE_REMOTING)
- scoped_refptr<remoting::JsonHostConfig> chromoting_config_;
- scoped_ptr<remoting::ChromotingHostContext> chromoting_context_;
- scoped_refptr<remoting::ChromotingHost> chromoting_host_;
-#endif
// An event that will be signalled when we shutdown.
base::WaitableEvent shutdown_event_;
- // The main message loop for the service process.
- MessageLoop* main_message_loop_;
-
DISALLOW_COPY_AND_ASSIGN(ServiceProcess);
};
extern ServiceProcess* g_service_process;
#endif // CHROME_SERVICE_SERVICE_PROCESS_H_
+