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

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

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_process.h ('k') | no next file » | 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 #include "chrome/service/service_process.h"
6
7 #include "chrome/service/cloud_print/cloud_print_proxy.h"
8
9 ServiceProcess* g_service_process = NULL;
10
11 ServiceProcess::ServiceProcess() {
12 DCHECK(!g_service_process);
13 g_service_process = this;
14 }
15
16 bool ServiceProcess::Initialize() {
17 base::Thread::Options options;
18 options.message_loop_type = MessageLoop::TYPE_IO;
19 io_thread_.reset(new base::Thread("ServiceProcess_IO"));
20 file_thread_.reset(new base::Thread("ServiceProcess_File"));
21 if (!io_thread_->StartWithOptions(options) ||
22 !file_thread_->StartWithOptions(options)) {
23 NOTREACHED();
24 Teardown();
25 return false;
26 }
27 return true;
28 }
29
30 bool ServiceProcess::Teardown() {
31 io_thread_.reset();
32 file_thread_.reset();
33 return true;
34 }
35
36 CloudPrintProxy* ServiceProcess::cloud_print_proxy() {
37 if (!cloud_print_proxy_.get()) {
38 cloud_print_proxy_.reset(new CloudPrintProxy());
39 cloud_print_proxy_->Initialize();
40 }
41 return cloud_print_proxy_.get();
42 }
43
44 ServiceProcess::~ServiceProcess() {
45 Teardown();
46 g_service_process = NULL;
47 }
48
OLDNEW
« no previous file with comments | « chrome/service/service_process.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698