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

Unified Diff: components/cronet/ios/cronet_environment.mm

Issue 2836063005: [cronet] Add mechanism for restarting CronetEnvironment (Closed)
Patch Set: sync Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/cronet/ios/Cronet.mm ('k') | components/cronet/ios/test/cronet_http_test.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/cronet/ios/cronet_environment.mm
diff --git a/components/cronet/ios/cronet_environment.mm b/components/cronet/ios/cronet_environment.mm
index faa88b798e7dd886f154f8662422965bfee945f7..246ead1984b7e2dbbee6840dddea31626063ce89 100644
--- a/components/cronet/ios/cronet_environment.mm
+++ b/components/cronet/ios/cronet_environment.mm
@@ -248,14 +248,20 @@ void CronetEnvironment::Start() {
}
CronetEnvironment::~CronetEnvironment() {
+ // TODO(lilyhoughton) make unregistering of this work.
// net::HTTPProtocolHandlerDelegate::SetInstance(nullptr);
- // 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();
+ // 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() {
« no previous file with comments | « components/cronet/ios/Cronet.mm ('k') | components/cronet/ios/test/cronet_http_test.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698