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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 scoped_refptr<base::SequencedTaskRunner> worker_thread; | 126 scoped_refptr<base::SequencedTaskRunner> worker_thread; |
127 #if !defined(OS_ANDROID) | 127 #if !defined(OS_ANDROID) |
128 worker_thread = io_worker_thread_->task_runner(); | 128 worker_thread = io_worker_thread_->task_runner(); |
129 #endif | 129 #endif |
130 context_.reset(new NetworkContext(base_path, worker_thread, this)); | 130 context_.reset(new NetworkContext(base_path, worker_thread, this)); |
131 tracing_.Initialize(shell_, url); | 131 tracing_.Initialize(shell_, url); |
132 } | 132 } |
133 | 133 |
134 bool NetworkServiceDelegate::AcceptConnection(Connection* connection) { | 134 bool NetworkServiceDelegate::AcceptConnection(Connection* connection) { |
135 DCHECK(context_); | 135 DCHECK(context_); |
136 connection->AddService<CookieStore>(this); | 136 connection->AddInterface<CookieStore>(this); |
137 connection->AddService<NetworkService>(this); | 137 connection->AddInterface<NetworkService>(this); |
138 connection->AddService<URLLoaderFactory>(this); | 138 connection->AddInterface<URLLoaderFactory>(this); |
139 connection->AddService<WebSocketFactory>(this); | 139 connection->AddInterface<WebSocketFactory>(this); |
140 return true; | 140 return true; |
141 } | 141 } |
142 | 142 |
143 bool NetworkServiceDelegate::ShellConnectionLost() { | 143 bool NetworkServiceDelegate::ShellConnectionLost() { |
144 EnsureIOThreadShutdown(); | 144 EnsureIOThreadShutdown(); |
145 return true; | 145 return true; |
146 } | 146 } |
147 | 147 |
148 void NetworkServiceDelegate::Quit() { | 148 void NetworkServiceDelegate::Quit() { |
149 EnsureIOThreadShutdown(); | 149 EnsureIOThreadShutdown(); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 FOR_EACH_OBSERVER(NetworkServiceDelegateObserver, observers_, | 192 FOR_EACH_OBSERVER(NetworkServiceDelegateObserver, observers_, |
193 OnIOWorkerThreadShutdown()); | 193 OnIOWorkerThreadShutdown()); |
194 | 194 |
195 // Destroy the io worker thread here so that we can commit any pending | 195 // Destroy the io worker thread here so that we can commit any pending |
196 // cookies here. | 196 // cookies here. |
197 io_worker_thread_.reset(); | 197 io_worker_thread_.reset(); |
198 } | 198 } |
199 } | 199 } |
200 | 200 |
201 } // namespace mojo | 201 } // namespace mojo |
OLD | NEW |