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

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

Issue 2444793002: Allow custom security descriptors when creating named pipes on Windows. (Closed)
Patch Set: Created 4 years, 1 month 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 | « no previous file | chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc » ('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 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 : named_pipe_(path.value()),
18 delegate_(delegate), 18 delegate_(delegate),
19 listen_handle_(mojo::edk::CreateServerHandle(named_pipe_, false)) { 19 listen_handle_(mojo::edk::CreateServerHandle(named_pipe_)) {
20 DCHECK(delegate_); 20 DCHECK(delegate_);
21 } 21 }
22 22
23 UnixDomainSocketAcceptor::~UnixDomainSocketAcceptor() { 23 UnixDomainSocketAcceptor::~UnixDomainSocketAcceptor() {
24 Close(); 24 Close();
25 } 25 }
26 26
27 bool UnixDomainSocketAcceptor::Listen() { 27 bool UnixDomainSocketAcceptor::Listen() {
28 if (!listen_handle_.is_valid()) 28 if (!listen_handle_.is_valid())
29 return false; 29 return false;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 return; 65 return;
66 listen_handle_.reset(); 66 listen_handle_.reset();
67 if (unlink(named_pipe_.name.c_str()) < 0) 67 if (unlink(named_pipe_.name.c_str()) < 0)
68 PLOG(ERROR) << "unlink"; 68 PLOG(ERROR) << "unlink";
69 69
70 // Unregister libevent for the listening socket and close it. 70 // Unregister libevent for the listening socket and close it.
71 server_listen_connection_watcher_.StopWatchingFileDescriptor(); 71 server_listen_connection_watcher_.StopWatchingFileDescriptor();
72 } 72 }
73 73
74 } // namespace apps 74 } // namespace apps
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698