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))); |