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

Side by Side Diff: sandbox/linux/services/broker_process.h

Issue 229893002: Add unit test to check for broker FD leak (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Be more explicit about allowing noisy tests Created 6 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef SANDBOX_LINUX_SERVICES_BROKER_PROCESS_H_ 5 #ifndef SANDBOX_LINUX_SERVICES_BROKER_PROCESS_H_
6 #define SANDBOX_LINUX_SERVICES_BROKER_PROCESS_H_ 6 #define SANDBOX_LINUX_SERVICES_BROKER_PROCESS_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 // doesn't support execute permissions. 53 // doesn't support execute permissions.
54 // It's similar to the access() system call and will return -errno on errors. 54 // It's similar to the access() system call and will return -errno on errors.
55 int Access(const char* pathname, int mode) const; 55 int Access(const char* pathname, int mode) const;
56 // Can be used in place of open(). Will be async signal safe. 56 // Can be used in place of open(). Will be async signal safe.
57 // The implementation only supports certain white listed flags and will 57 // The implementation only supports certain white listed flags and will
58 // return -EPERM on other flags. 58 // return -EPERM on other flags.
59 // It's similar to the open() system call and will return -errno on errors. 59 // It's similar to the open() system call and will return -errno on errors.
60 int Open(const char* pathname, int flags) const; 60 int Open(const char* pathname, int flags) const;
61 61
62 int broker_pid() const { return broker_pid_; } 62 int broker_pid() const { return broker_pid_; }
63 int ipc_socketpair() const { return ipc_socketpair_; }
63 64
64 private: 65 private:
65 enum IPCCommands { 66 enum IPCCommands {
66 kCommandInvalid = 0, 67 kCommandInvalid = 0,
67 kCommandOpen, 68 kCommandOpen,
68 kCommandAccess, 69 kCommandAccess,
69 }; 70 };
70 int PathAndFlagsSyscall(enum IPCCommands command_type, 71 int PathAndFlagsSyscall(enum IPCCommands command_type,
71 const char* pathname, 72 const char* pathname,
72 int flags) const; 73 int flags) const;
(...skipping 22 matching lines...) Expand all
95 pid_t broker_pid_; // The PID of the broker (child). 96 pid_t broker_pid_; // The PID of the broker (child).
96 const std::vector<std::string> allowed_r_files_; // Files allowed for read. 97 const std::vector<std::string> allowed_r_files_; // Files allowed for read.
97 const std::vector<std::string> allowed_w_files_; // Files allowed for write. 98 const std::vector<std::string> allowed_w_files_; // Files allowed for write.
98 int ipc_socketpair_; // Our communication channel to parent or child. 99 int ipc_socketpair_; // Our communication channel to parent or child.
99 DISALLOW_IMPLICIT_CONSTRUCTORS(BrokerProcess); 100 DISALLOW_IMPLICIT_CONSTRUCTORS(BrokerProcess);
100 }; 101 };
101 102
102 } // namespace sandbox 103 } // namespace sandbox
103 104
104 #endif // SANDBOX_LINUX_SERVICES_BROKER_PROCESS_H_ 105 #endif // SANDBOX_LINUX_SERVICES_BROKER_PROCESS_H_
OLDNEW
« no previous file with comments | « no previous file | sandbox/linux/services/broker_process_unittest.cc » ('j') | sandbox/linux/services/broker_process_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698