Index: chrome/service/service_process.cc |
diff --git a/chrome/service/service_process.cc b/chrome/service/service_process.cc |
index f820f938d6401a95a76f0692788265fd65ed5c82..4f510be5fcfff0866ffdf66bbab6440f4e8b405f 100644 |
--- a/chrome/service/service_process.cc |
+++ b/chrome/service/service_process.cc |
@@ -209,6 +209,8 @@ bool ServiceProcess::Initialize(MessageLoopForUI* message_loop, |
} |
bool ServiceProcess::Teardown() { |
+ if (request_context_getter_.get()) |
+ request_context_getter_->StartTearDown(); |
service_prefs_.reset(); |
cloud_print_proxy_.reset(); |
@@ -218,6 +220,9 @@ bool ServiceProcess::Teardown() { |
shutdown_event_.Signal(); |
io_thread_.reset(); |
file_thread_.reset(); |
+ // The ServiceURLRequestContextGetter must be destroyed after the other |
+ // threads so that its shutdown tasks have a chance to run. |
+ request_context_getter_ = NULL; |
// The NetworkChangeNotifier must be destroyed after all other threads that |
// might use it have been shut down. |
network_change_notifier_.reset(); |