OLD | NEW |
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 CHROME_SERVICE_SERVICE_PROCESS_H_ | 5 #ifndef CHROME_SERVICE_SERVICE_PROCESS_H_ |
6 #define CHROME_SERVICE_SERVICE_PROCESS_H_ | 6 #define CHROME_SERVICE_SERVICE_PROCESS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 class NetworkChangeNotifier; | 28 class NetworkChangeNotifier; |
29 } | 29 } |
30 | 30 |
31 // The ServiceProcess does not inherit from ChildProcess because this | 31 // The ServiceProcess does not inherit from ChildProcess because this |
32 // process can live independently of the browser process. | 32 // process can live independently of the browser process. |
33 // ServiceProcess Design Notes | 33 // ServiceProcess Design Notes |
34 // https://sites.google.com/a/chromium.org/dev/developers/design-documents/servi
ce-processes | 34 // https://sites.google.com/a/chromium.org/dev/developers/design-documents/servi
ce-processes |
35 class ServiceProcess : public cloud_print::CloudPrintProxy::Client { | 35 class ServiceProcess : public cloud_print::CloudPrintProxy::Client { |
36 public: | 36 public: |
37 ServiceProcess(); | 37 ServiceProcess(); |
38 virtual ~ServiceProcess(); | 38 ~ServiceProcess() override; |
39 | 39 |
40 // Initialize the ServiceProcess with the message loop that it should run on. | 40 // Initialize the ServiceProcess with the message loop that it should run on. |
41 // ServiceProcess takes ownership of |state|. | 41 // ServiceProcess takes ownership of |state|. |
42 bool Initialize(base::MessageLoopForUI* message_loop, | 42 bool Initialize(base::MessageLoopForUI* message_loop, |
43 const base::CommandLine& command_line, | 43 const base::CommandLine& command_line, |
44 ServiceProcessState* state); | 44 ServiceProcessState* state); |
45 | 45 |
46 bool Teardown(); | 46 bool Teardown(); |
47 // TODO(sanjeevr): Change various parts of the code such as | 47 // TODO(sanjeevr): Change various parts of the code such as |
48 // net::ProxyService::CreateSystemProxyConfigService to take in | 48 // net::ProxyService::CreateSystemProxyConfigService to take in |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 bool update_available() const { return update_available_; } | 83 bool update_available() const { return update_available_; } |
84 | 84 |
85 // Called by the IPC server when a client disconnects. A return value of | 85 // Called by the IPC server when a client disconnects. A return value of |
86 // true indicates that the IPC server should continue listening for new | 86 // true indicates that the IPC server should continue listening for new |
87 // connections. | 87 // connections. |
88 bool HandleClientDisconnect(); | 88 bool HandleClientDisconnect(); |
89 | 89 |
90 cloud_print::CloudPrintProxy* GetCloudPrintProxy(); | 90 cloud_print::CloudPrintProxy* GetCloudPrintProxy(); |
91 | 91 |
92 // CloudPrintProxy::Client implementation. | 92 // CloudPrintProxy::Client implementation. |
93 virtual void OnCloudPrintProxyEnabled(bool persist_state) override; | 93 void OnCloudPrintProxyEnabled(bool persist_state) override; |
94 virtual void OnCloudPrintProxyDisabled(bool persist_state) override; | 94 void OnCloudPrintProxyDisabled(bool persist_state) override; |
95 | 95 |
96 ServiceURLRequestContextGetter* GetServiceURLRequestContextGetter(); | 96 ServiceURLRequestContextGetter* GetServiceURLRequestContextGetter(); |
97 | 97 |
98 private: | 98 private: |
99 friend class TestServiceProcess; | 99 friend class TestServiceProcess; |
100 | 100 |
101 // Schedule a call to ShutdownIfNeeded. | 101 // Schedule a call to ShutdownIfNeeded. |
102 void ScheduleShutdownCheck(); | 102 void ScheduleShutdownCheck(); |
103 | 103 |
104 // Shuts down the process if no services are enabled and no clients are | 104 // Shuts down the process if no services are enabled and no clients are |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 bool update_available_; | 144 bool update_available_; |
145 | 145 |
146 scoped_refptr<ServiceURLRequestContextGetter> request_context_getter_; | 146 scoped_refptr<ServiceURLRequestContextGetter> request_context_getter_; |
147 | 147 |
148 DISALLOW_COPY_AND_ASSIGN(ServiceProcess); | 148 DISALLOW_COPY_AND_ASSIGN(ServiceProcess); |
149 }; | 149 }; |
150 | 150 |
151 extern ServiceProcess* g_service_process; | 151 extern ServiceProcess* g_service_process; |
152 | 152 |
153 #endif // CHROME_SERVICE_SERVICE_PROCESS_H_ | 153 #endif // CHROME_SERVICE_SERVICE_PROCESS_H_ |
OLD | NEW |