Chromium Code Reviews| Index: components/cronet/ios/cronet_environment.mm |
| diff --git a/components/cronet/ios/cronet_environment.mm b/components/cronet/ios/cronet_environment.mm |
| index 651af1dc9cb8800b204b276596333a674c432260..17e72612ba145b5fb7954c4ef8bc2104e3d7dea7 100644 |
| --- a/components/cronet/ios/cronet_environment.mm |
| +++ b/components/cronet/ios/cronet_environment.mm |
| @@ -251,12 +251,17 @@ void CronetEnvironment::Start() { |
| CronetEnvironment::~CronetEnvironment() { |
| // net::HTTPProtocolHandlerDelegate::SetInstance(nullptr); |
|
mef
2017/05/01 19:12:58
Please add TODO to make unregistering of HTTPProto
lilyhoughton
2017/05/01 19:28:12
Done.
|
| - // TODO(lilyhoughton) right now this is relying on there being |
| - // only one CronetEnvironment (per process). if (when?) that |
| - // changes, so will this have to. |
| - base::TaskScheduler* ts = base::TaskScheduler::GetInstance(); |
| - if (ts) |
| - ts->Shutdown(); |
| + // TODO(lilyhoughton) this can only be run once, so right now leaking it. |
| + // Should be be called when the _last_ CronetEnvironment is destroyed. |
| + // base::TaskScheduler* ts = base::TaskScheduler::GetInstance(); |
|
mef
2017/05/01 19:12:58
Do we actually need to call this at all?
lilyhoughton
2017/05/01 19:28:12
I will do more research to check.
|
| + // if (ts) |
| + // ts->Shutdown(); |
| + |
| + // TODO(lilyhoughton) this should be smarter about making sure there are no |
| + // pending requests, etc. |
| + |
| + network_io_thread_->task_runner().get()->DeleteSoon(FROM_HERE, |
| + main_context_.release()); |
| } |
| void CronetEnvironment::InitializeOnNetworkThread() { |