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

Unified Diff: mojo/services/network/main.cc

Issue 407593002: mojo: make NetworkServiceImpl clean up after itself (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 6 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/network/main.cc
diff --git a/mojo/services/network/main.cc b/mojo/services/network/main.cc
index a3f397d8a5b2cf226e3676de854a74347f54fc1a..df7a95e88e68d4d2b638d203a09852e99eb9e2bc 100644
--- a/mojo/services/network/main.cc
+++ b/mojo/services/network/main.cc
@@ -66,10 +66,17 @@ extern "C" APPLICATION_EXPORT MojoResult CDECL MojoMain(
base::AtExitManager at_exit;
#endif
+ // The Delegate owns the NetworkContext, which needs to outlive
+ // MessageLoopForIO. Destruction of the message loop will serve to
+ // invalidate connections made to network services (URLLoader) and cause
+ // the service instances to be cleaned up as a result of observing pipe
+ // errors. This is important as ~URLRequestContext asserts that no out-
+ // standing URLRequests exist.
+ Delegate delegate;
darin (slow to review) 2014/07/19 03:54:44 I might call out the scoping a bit more explicitly
+
// The IO message loop allows us to use net::URLRequest on this thread.
base::MessageLoopForIO loop;
- Delegate delegate;
mojo::ApplicationImpl app(
&delegate, mojo::MakeScopedHandle(mojo::MessagePipeHandle(shell_handle)));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698