Commit db983b34 authored by Francois Doray's avatar Francois Doray Committed by Commit Bot

Remove the file thread from the service process.

The file thread is no longer used. TaskScheduler should be used for
all file operations.

Bug: 
Change-Id: Iba07dc70a721c2c84cdb7ac00b7d4be057ae83aa
Reviewed-on: https://chromium-review.googlesource.com/660599Reviewed-by: default avatarGene Gutnik <gene@chromium.org>
Commit-Queue: Francois Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#501273}
parent 52e0469c
......@@ -178,9 +178,7 @@ bool ServiceProcess::Initialize(base::MessageLoopForUI* message_loop,
base::Thread::Options options;
options.message_loop_type = base::MessageLoop::TYPE_IO;
io_thread_.reset(new ServiceIOThread("ServiceProcess_IO"));
file_thread_.reset(new base::Thread("ServiceProcess_File"));
if (!io_thread_->StartWithOptions(options) ||
!file_thread_->StartWithOptions(options)) {
if (!io_thread_->StartWithOptions(options)) {
NOTREACHED();
Teardown();
return false;
......@@ -273,7 +271,6 @@ bool ServiceProcess::Teardown() {
// background threads can cleanup.
shutdown_event_.Signal();
io_thread_.reset();
file_thread_.reset();
if (base::TaskScheduler::GetInstance())
base::TaskScheduler::GetInstance()->Shutdown();
......
......@@ -64,14 +64,6 @@ class ServiceProcess : public ServiceIPCServer::Client,
return io_thread_ ? io_thread_->task_runner() : nullptr;
}
// Returns the SingleThreadTaskRunner for the service process file thread.
// Used to do I/O operations (not network requests or even file: URL requests)
// to avoid blocking the main thread. Returns null before Initialize is
// called and after Teardown is called.
scoped_refptr<base::SingleThreadTaskRunner> file_task_runner() {
return file_thread_ ? file_thread_->task_runner() : nullptr;
}
// A global event object that is signalled when the main thread's message
// loop exits. This gives background threads a way to observe the main
// thread shutting down.
......@@ -120,7 +112,6 @@ class ServiceProcess : public ServiceIPCServer::Client,
std::unique_ptr<net::NetworkChangeNotifier> network_change_notifier_;
std::unique_ptr<base::Thread> io_thread_;
std::unique_ptr<base::Thread> file_thread_;
std::unique_ptr<cloud_print::CloudPrintProxy> cloud_print_proxy_;
std::unique_ptr<ServiceProcessPrefs> service_prefs_;
std::unique_ptr<ServiceIPCServer> ipc_server_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment