OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/ref_counted.h" | 10 #include "base/ref_counted.h" |
11 #include "base/thread.h" | 11 #include "base/thread.h" |
12 | 12 |
13 class CloudPrintProxy; | 13 class CloudPrintProxy; |
14 class JsonPrefStore; | 14 class JsonPrefStore; |
15 class ServiceNetworkChangeNotifierThread; | 15 namespace net { |
| 16 class NetworkChangeNotifier; |
| 17 } |
16 | 18 |
17 // The ServiceProcess does not inherit from ChildProcess because this | 19 // The ServiceProcess does not inherit from ChildProcess because this |
18 // process can live independently of the browser process. | 20 // process can live independently of the browser process. |
19 class ServiceProcess { | 21 class ServiceProcess { |
20 public: | 22 public: |
21 ServiceProcess(); | 23 ServiceProcess(); |
22 ~ServiceProcess(); | 24 ~ServiceProcess(); |
23 | 25 |
24 bool Initialize(); | 26 bool Initialize(); |
25 bool Teardown(); | 27 bool Teardown(); |
(...skipping 13 matching lines...) Expand all Loading... |
39 base::Thread* io_thread() const { | 41 base::Thread* io_thread() const { |
40 return io_thread_.get(); | 42 return io_thread_.get(); |
41 } | 43 } |
42 // Returns the thread that we perform random file operations on. For code | 44 // Returns the thread that we perform random file operations on. For code |
43 // that wants to do I/O operations (not network requests or even file: URL | 45 // that wants to do I/O operations (not network requests or even file: URL |
44 // requests), this is the thread to use to avoid blocking the UI thread. | 46 // requests), this is the thread to use to avoid blocking the UI thread. |
45 base::Thread* file_thread() const { | 47 base::Thread* file_thread() const { |
46 return file_thread_.get(); | 48 return file_thread_.get(); |
47 } | 49 } |
48 CloudPrintProxy* CreateCloudPrintProxy(JsonPrefStore* service_prefs); | 50 CloudPrintProxy* CreateCloudPrintProxy(JsonPrefStore* service_prefs); |
49 ServiceNetworkChangeNotifierThread* network_change_notifier_thread() const { | |
50 return network_change_notifier_thread_.get(); | |
51 } | |
52 | 51 |
53 private: | 52 private: |
| 53 scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_; |
54 scoped_ptr<base::Thread> io_thread_; | 54 scoped_ptr<base::Thread> io_thread_; |
55 scoped_ptr<base::Thread> file_thread_; | 55 scoped_ptr<base::Thread> file_thread_; |
56 std::vector<CloudPrintProxy*> cloud_print_proxy_list_; | 56 std::vector<CloudPrintProxy*> cloud_print_proxy_list_; |
57 scoped_refptr<ServiceNetworkChangeNotifierThread> | |
58 network_change_notifier_thread_; | |
59 | 57 |
60 DISALLOW_COPY_AND_ASSIGN(ServiceProcess); | 58 DISALLOW_COPY_AND_ASSIGN(ServiceProcess); |
61 }; | 59 }; |
62 | 60 |
63 extern ServiceProcess* g_service_process; | 61 extern ServiceProcess* g_service_process; |
64 | 62 |
65 #endif // CHROME_SERVICE_SERVICE_PROCESS_H_ | 63 #endif // CHROME_SERVICE_SERVICE_PROCESS_H_ |
66 | 64 |
OLD | NEW |