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 #include "chrome/service/service_process.h" | 5 #include "chrome/service/service_process.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 base::Thread::Options options; | 147 base::Thread::Options options; |
148 options.message_loop_type = base::MessageLoop::TYPE_IO; | 148 options.message_loop_type = base::MessageLoop::TYPE_IO; |
149 io_thread_.reset(new ServiceIOThread("ServiceProcess_IO")); | 149 io_thread_.reset(new ServiceIOThread("ServiceProcess_IO")); |
150 file_thread_.reset(new base::Thread("ServiceProcess_File")); | 150 file_thread_.reset(new base::Thread("ServiceProcess_File")); |
151 if (!io_thread_->StartWithOptions(options) || | 151 if (!io_thread_->StartWithOptions(options) || |
152 !file_thread_->StartWithOptions(options)) { | 152 !file_thread_->StartWithOptions(options)) { |
153 NOTREACHED(); | 153 NOTREACHED(); |
154 Teardown(); | 154 Teardown(); |
155 return false; | 155 return false; |
156 } | 156 } |
157 blocking_pool_ = new base::SequencedWorkerPool(3, "ServiceBlocking"); | 157 blocking_pool_ = new base::SequencedWorkerPool( |
| 158 3, "ServiceBlocking", base::TaskPriority::USER_VISIBLE); |
158 | 159 |
159 // Initialize Mojo early so things can use it. | 160 // Initialize Mojo early so things can use it. |
160 mojo::edk::Init(); | 161 mojo::edk::Init(); |
161 mojo_ipc_support_.reset( | 162 mojo_ipc_support_.reset( |
162 new mojo::edk::ScopedIPCSupport(io_thread_->task_runner())); | 163 new mojo::edk::ScopedIPCSupport(io_thread_->task_runner())); |
163 | 164 |
164 request_context_getter_ = new ServiceURLRequestContextGetter(); | 165 request_context_getter_ = new ServiceURLRequestContextGetter(); |
165 | 166 |
166 base::FilePath user_data_dir; | 167 base::FilePath user_data_dir; |
167 PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); | 168 PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 } else { | 377 } else { |
377 Shutdown(); | 378 Shutdown(); |
378 } | 379 } |
379 } | 380 } |
380 } | 381 } |
381 | 382 |
382 ServiceProcess::~ServiceProcess() { | 383 ServiceProcess::~ServiceProcess() { |
383 Teardown(); | 384 Teardown(); |
384 g_service_process = NULL; | 385 g_service_process = NULL; |
385 } | 386 } |
OLD | NEW |