Index: mojo/services/network/network_service_impl.cc |
diff --git a/mojo/services/network/network_service_impl.cc b/mojo/services/network/network_service_impl.cc |
index 6f2f5502d645d78dbf466e2e3558922814fe6d0f..708208a2b8159d11a7e1813e5560096bfb737a14 100644 |
--- a/mojo/services/network/network_service_impl.cc |
+++ b/mojo/services/network/network_service_impl.cc |
@@ -25,7 +25,10 @@ NetworkServiceImpl::~NetworkServiceImpl() { |
void NetworkServiceImpl::CreateURLLoader(InterfaceRequest<URLLoader> loader) { |
// TODO(darin): Plumb origin_. Use for CORS. |
- BindToRequest(new URLLoaderImpl(context_), &loader); |
+ // The loader will delete itself when the pipe is closed, unless a request is |
+ // in progress. In which case, the loader will delete itself when the request |
+ // is finished. |
+ new URLLoaderImpl(context_, loader.Pass()); |
} |
void NetworkServiceImpl::GetCookieStore(InterfaceRequest<CookieStore> store) { |