OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "mojo/services/network/network_service_delegate.h" | 5 #include "mojo/services/network/network_service_delegate.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
10 #include "base/base_paths.h" | 10 #include "base/base_paths.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 71 |
72 bool NetworkServiceDelegate::AcceptConnection(Connection* connection) { | 72 bool NetworkServiceDelegate::AcceptConnection(Connection* connection) { |
73 DCHECK(context_); | 73 DCHECK(context_); |
74 connection->AddInterface<CookieStore>(this); | 74 connection->AddInterface<CookieStore>(this); |
75 connection->AddInterface<NetworkService>(this); | 75 connection->AddInterface<NetworkService>(this); |
76 connection->AddInterface<URLLoaderFactory>(this); | 76 connection->AddInterface<URLLoaderFactory>(this); |
77 connection->AddInterface<WebSocketFactory>(this); | 77 connection->AddInterface<WebSocketFactory>(this); |
78 return true; | 78 return true; |
79 } | 79 } |
80 | 80 |
| 81 void NetworkServiceDelegate::ShellConnectionLost() { |
| 82 base::MessageLoop::current()->QuitWhenIdle(); |
| 83 } |
| 84 |
81 void NetworkServiceDelegate::Create(Connection* connection, | 85 void NetworkServiceDelegate::Create(Connection* connection, |
82 InterfaceRequest<NetworkService> request) { | 86 InterfaceRequest<NetworkService> request) { |
83 new NetworkServiceImpl(ref_factory_.CreateRef(), std::move(request)); | 87 new NetworkServiceImpl(ref_factory_.CreateRef(), std::move(request)); |
84 } | 88 } |
85 | 89 |
86 void NetworkServiceDelegate::Create(Connection* connection, | 90 void NetworkServiceDelegate::Create(Connection* connection, |
87 InterfaceRequest<CookieStore> request) { | 91 InterfaceRequest<CookieStore> request) { |
88 // TODO(beng): need to find a way to get content origin. | 92 // TODO(beng): need to find a way to get content origin. |
89 new CookieStoreImpl( | 93 new CookieStoreImpl( |
90 context_.get(), GURL(), | 94 context_.get(), GURL(), |
(...skipping 15 matching lines...) Expand all Loading... |
106 } | 110 } |
107 | 111 |
108 void NetworkServiceDelegate::Quit() { | 112 void NetworkServiceDelegate::Quit() { |
109 // Destroy the NetworkContext now as it requires MessageLoop::current() upon | 113 // Destroy the NetworkContext now as it requires MessageLoop::current() upon |
110 // destruction and it is the last moment we know for sure that it is | 114 // destruction and it is the last moment we know for sure that it is |
111 // running. | 115 // running. |
112 context_.reset(); | 116 context_.reset(); |
113 } | 117 } |
114 | 118 |
115 } // namespace mojo | 119 } // namespace mojo |
OLD | NEW |