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

Side by Side Diff: chrome/service/service_process.h

Issue 2001009: Created a new process type called the service process to host background task... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 7 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
« no previous file with comments | « chrome/service/service_main.cc ('k') | chrome/service/service_process.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_SERVICE_SERVICE_PROCESS_H_
6 #define CHROME_SERVICE_SERVICE_PROCESS_H_
7
8
9 #include "base/thread.h"
10
11 class CloudPrintProxy;
12
13 // The ServiceProcess does not inherit from ChildProcess because this
14 // process can live independently of the browser process.
15 class ServiceProcess {
16 public:
17 ServiceProcess();
18 ~ServiceProcess();
19
20 bool Initialize();
21 bool Teardown();
22 // TODO(sanjeevr): Change various parts of the code such as
23 // net::ProxyService::CreateSystemProxyConfigService to take in
24 // MessageLoopProxy* instead of MessageLoop*. When we have done that, we can
25 // remove the io_thread() and file_thread() accessors and replace them with
26 // io_message_loop_proxy() and file_message_loop_proxy() respectively.
27
28 // Returns the thread that we perform I/O coordination on (network requests,
29 // communication with renderers, etc.
30 // NOTE: You should ONLY use this to pass to IPC or other objects which must
31 // need a MessageLoop*. If you just want to post a task, use the thread's
32 // message_loop_proxy() as it takes care of checking that a thread is still
33 // alive, race conditions, lifetime differences etc.
34 // If you still must use this, need to check the return value for NULL.
35 base::Thread* io_thread() const {
36 return io_thread_.get();
37 }
38 // Returns the thread that we perform random file operations on. For code
39 // that wants to do I/O operations (not network requests or even file: URL
40 // requests), this is the thread to use to avoid blocking the UI thread.
41 base::Thread* file_thread() const {
42 return file_thread_.get();
43 }
44 CloudPrintProxy* cloud_print_proxy();
45
46 private:
47 scoped_ptr<base::Thread> io_thread_;
48 scoped_ptr<base::Thread> file_thread_;
49 scoped_ptr<CloudPrintProxy> cloud_print_proxy_;
50
51 DISALLOW_COPY_AND_ASSIGN(ServiceProcess);
52 };
53
54 extern ServiceProcess* g_service_process;
55
56 #endif // CHROME_SERVICE_SERVICE_PROCESS_H_
57
OLDNEW
« no previous file with comments | « chrome/service/service_main.cc ('k') | chrome/service/service_process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698