Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Side by Side Diff: mojo/services/network/network_service_delegate.cc

Issue 1819063002: Quit the message loop by default in ShellConnectionLost when ApplicationRunner is used (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge and update resourceproviderunittest Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojo/services/network/network_service_delegate.h ('k') | mojo/services/tracing/tracing_app.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « mojo/services/network/network_service_delegate.h ('k') | mojo/services/tracing/tracing_app.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698