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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/service/service_main.cc ('k') | chrome/service/service_process.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/service/service_process.h
===================================================================
--- chrome/service/service_process.h (revision 0)
+++ chrome/service/service_process.h (revision 0)
@@ -0,0 +1,57 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_SERVICE_SERVICE_PROCESS_H_
+#define CHROME_SERVICE_SERVICE_PROCESS_H_
+
+
+#include "base/thread.h"
+
+class CloudPrintProxy;
+
+// The ServiceProcess does not inherit from ChildProcess because this
+// process can live independently of the browser process.
+class ServiceProcess {
+ public:
+ ServiceProcess();
+ ~ServiceProcess();
+
+ bool Initialize();
+ bool Teardown();
+ // TODO(sanjeevr): Change various parts of the code such as
+ // net::ProxyService::CreateSystemProxyConfigService to take in
+ // MessageLoopProxy* instead of MessageLoop*. When we have done that, we can
+ // remove the io_thread() and file_thread() accessors and replace them with
+ // io_message_loop_proxy() and file_message_loop_proxy() respectively.
+
+ // Returns the thread that we perform I/O coordination on (network requests,
+ // communication with renderers, etc.
+ // NOTE: You should ONLY use this to pass to IPC or other objects which must
+ // need a MessageLoop*. If you just want to post a task, use the thread's
+ // message_loop_proxy() as it takes care of checking that a thread is still
+ // alive, race conditions, lifetime differences etc.
+ // If you still must use this, need to check the return value for NULL.
+ base::Thread* io_thread() const {
+ return io_thread_.get();
+ }
+ // Returns the thread that we perform random file operations on. For code
+ // that wants to do I/O operations (not network requests or even file: URL
+ // requests), this is the thread to use to avoid blocking the UI thread.
+ base::Thread* file_thread() const {
+ return file_thread_.get();
+ }
+ CloudPrintProxy* cloud_print_proxy();
+
+ private:
+ scoped_ptr<base::Thread> io_thread_;
+ scoped_ptr<base::Thread> file_thread_;
+ scoped_ptr<CloudPrintProxy> cloud_print_proxy_;
+
+ DISALLOW_COPY_AND_ASSIGN(ServiceProcess);
+};
+
+extern ServiceProcess* g_service_process;
+
+#endif // CHROME_SERVICE_SERVICE_PROCESS_H_
+
Property changes on: chrome\service\service_process.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« 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