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

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

Issue 1821913002: Revert of 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: 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
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
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
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