OLD | NEW |
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_WIN_SRC_BROKER_SERVICES_H_ | 5 #ifndef SANDBOX_WIN_SRC_BROKER_SERVICES_H_ |
6 #define SANDBOX_WIN_SRC_BROKER_SERVICES_H_ | 6 #define SANDBOX_WIN_SRC_BROKER_SERVICES_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 class PolicyBase; | 31 class PolicyBase; |
32 | 32 |
33 // BrokerServicesBase --------------------------------------------------------- | 33 // BrokerServicesBase --------------------------------------------------------- |
34 // Broker implementation version 0 | 34 // Broker implementation version 0 |
35 // | 35 // |
36 // This is an implementation of the interface BrokerServices and | 36 // This is an implementation of the interface BrokerServices and |
37 // of the associated TargetProcess interface. In this implementation | 37 // of the associated TargetProcess interface. In this implementation |
38 // TargetProcess is a friend of BrokerServices where the later manages a | 38 // TargetProcess is a friend of BrokerServices where the later manages a |
39 // collection of the former. | 39 // collection of the former. |
40 class BrokerServicesBase FINAL : public BrokerServices, | 40 class BrokerServicesBase final : public BrokerServices, |
41 public SingletonBase<BrokerServicesBase> { | 41 public SingletonBase<BrokerServicesBase> { |
42 public: | 42 public: |
43 BrokerServicesBase(); | 43 BrokerServicesBase(); |
44 | 44 |
45 ~BrokerServicesBase(); | 45 ~BrokerServicesBase(); |
46 | 46 |
47 // BrokerServices interface. | 47 // BrokerServices interface. |
48 virtual ResultCode Init() OVERRIDE; | 48 virtual ResultCode Init() override; |
49 virtual TargetPolicy* CreatePolicy() OVERRIDE; | 49 virtual TargetPolicy* CreatePolicy() override; |
50 virtual ResultCode SpawnTarget(const wchar_t* exe_path, | 50 virtual ResultCode SpawnTarget(const wchar_t* exe_path, |
51 const wchar_t* command_line, | 51 const wchar_t* command_line, |
52 TargetPolicy* policy, | 52 TargetPolicy* policy, |
53 PROCESS_INFORMATION* target) OVERRIDE; | 53 PROCESS_INFORMATION* target) override; |
54 virtual ResultCode WaitForAllTargets() OVERRIDE; | 54 virtual ResultCode WaitForAllTargets() override; |
55 virtual ResultCode AddTargetPeer(HANDLE peer_process) OVERRIDE; | 55 virtual ResultCode AddTargetPeer(HANDLE peer_process) override; |
56 virtual ResultCode InstallAppContainer(const wchar_t* sid, | 56 virtual ResultCode InstallAppContainer(const wchar_t* sid, |
57 const wchar_t* name) OVERRIDE; | 57 const wchar_t* name) override; |
58 virtual ResultCode UninstallAppContainer(const wchar_t* sid) OVERRIDE; | 58 virtual ResultCode UninstallAppContainer(const wchar_t* sid) override; |
59 | 59 |
60 // Checks if the supplied process ID matches one of the broker's active | 60 // Checks if the supplied process ID matches one of the broker's active |
61 // target processes | 61 // target processes |
62 // Returns: | 62 // Returns: |
63 // true if there is an active target process for this ID, otherwise false. | 63 // true if there is an active target process for this ID, otherwise false. |
64 bool IsActiveTarget(DWORD process_id); | 64 bool IsActiveTarget(DWORD process_id); |
65 | 65 |
66 private: | 66 private: |
67 // Releases the Job and notifies the associated Policy object to its | 67 // Releases the Job and notifies the associated Policy object to its |
68 // resources as well. | 68 // resources as well. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 typedef std::map<uint32_t, std::pair<HANDLE, HANDLE>> TokenCacheMap; | 109 typedef std::map<uint32_t, std::pair<HANDLE, HANDLE>> TokenCacheMap; |
110 TokenCacheMap token_cache_; | 110 TokenCacheMap token_cache_; |
111 | 111 |
112 DISALLOW_COPY_AND_ASSIGN(BrokerServicesBase); | 112 DISALLOW_COPY_AND_ASSIGN(BrokerServicesBase); |
113 }; | 113 }; |
114 | 114 |
115 } // namespace sandbox | 115 } // namespace sandbox |
116 | 116 |
117 | 117 |
118 #endif // SANDBOX_WIN_SRC_BROKER_SERVICES_H_ | 118 #endif // SANDBOX_WIN_SRC_BROKER_SERVICES_H_ |
OLD | NEW |