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 | |
85 void NetworkServiceDelegate::Create(Connection* connection, | 81 void NetworkServiceDelegate::Create(Connection* connection, |
86 InterfaceRequest<NetworkService> request) { | 82 InterfaceRequest<NetworkService> request) { |
87 new NetworkServiceImpl(ref_factory_.CreateRef(), std::move(request)); | 83 new NetworkServiceImpl(ref_factory_.CreateRef(), std::move(request)); |
88 } | 84 } |
89 | 85 |
90 void NetworkServiceDelegate::Create(Connection* connection, | 86 void NetworkServiceDelegate::Create(Connection* connection, |
91 InterfaceRequest<CookieStore> request) { | 87 InterfaceRequest<CookieStore> request) { |
92 // TODO(beng): need to find a way to get content origin. | 88 // TODO(beng): need to find a way to get content origin. |
93 new CookieStoreImpl( | 89 new CookieStoreImpl( |
94 context_.get(), GURL(), | 90 context_.get(), GURL(), |
(...skipping 15 matching lines...) Expand all Loading... |
110 } | 106 } |
111 | 107 |
112 void NetworkServiceDelegate::Quit() { | 108 void NetworkServiceDelegate::Quit() { |
113 // Destroy the NetworkContext now as it requires MessageLoop::current() upon | 109 // Destroy the NetworkContext now as it requires MessageLoop::current() upon |
114 // destruction and it is the last moment we know for sure that it is | 110 // destruction and it is the last moment we know for sure that it is |
115 // running. | 111 // running. |
116 context_.reset(); | 112 context_.reset(); |
117 } | 113 } |
118 | 114 |
119 } // namespace mojo | 115 } // namespace mojo |
OLD | NEW |