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

Side by Side Diff: chrome/browser/apps/app_shim/unix_domain_socket_acceptor.cc

Issue 2695593009: Use the location where FileDescriptorWatcher is created to track the libevent handlers (Closed)
Patch Set: fix mac. Created 3 years, 10 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/apps/app_shim/unix_domain_socket_acceptor.h" 5 #include "chrome/browser/apps/app_shim/unix_domain_socket_acceptor.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "mojo/edk/embedder/named_platform_handle_utils.h" 10 #include "mojo/edk/embedder/named_platform_handle_utils.h"
11 #include "mojo/edk/embedder/platform_channel_utils_posix.h" 11 #include "mojo/edk/embedder/platform_channel_utils_posix.h"
12 12
13 namespace apps { 13 namespace apps {
14 14
15 UnixDomainSocketAcceptor::UnixDomainSocketAcceptor(const base::FilePath& path, 15 UnixDomainSocketAcceptor::UnixDomainSocketAcceptor(const base::FilePath& path,
16 Delegate* delegate) 16 Delegate* delegate)
17 : named_pipe_(path.value()), 17 : server_listen_connection_watcher_(FROM_HERE),
18 named_pipe_(path.value()),
18 delegate_(delegate), 19 delegate_(delegate),
19 listen_handle_(mojo::edk::CreateServerHandle(named_pipe_)) { 20 listen_handle_(mojo::edk::CreateServerHandle(named_pipe_)) {
20 DCHECK(delegate_); 21 DCHECK(delegate_);
21 } 22 }
22 23
23 UnixDomainSocketAcceptor::~UnixDomainSocketAcceptor() { 24 UnixDomainSocketAcceptor::~UnixDomainSocketAcceptor() {
24 Close(); 25 Close();
25 } 26 }
26 27
27 bool UnixDomainSocketAcceptor::Listen() { 28 bool UnixDomainSocketAcceptor::Listen() {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 return; 66 return;
66 listen_handle_.reset(); 67 listen_handle_.reset();
67 if (unlink(named_pipe_.name.c_str()) < 0) 68 if (unlink(named_pipe_.name.c_str()) < 0)
68 PLOG(ERROR) << "unlink"; 69 PLOG(ERROR) << "unlink";
69 70
70 // Unregister libevent for the listening socket and close it. 71 // Unregister libevent for the listening socket and close it.
71 server_listen_connection_watcher_.StopWatchingFileDescriptor(); 72 server_listen_connection_watcher_.StopWatchingFileDescriptor();
72 } 73 }
73 74
74 } // namespace apps 75 } // namespace apps
OLDNEW
« no previous file with comments | « base/message_loop/message_pump_libevent_unittest.cc ('k') | chrome/browser/chrome_browser_main_extra_parts_exo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698