OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_SANDBOX_POLICY_BASE_H_ | 5 #ifndef SANDBOX_WIN_SRC_SANDBOX_POLICY_BASE_H_ |
6 #define SANDBOX_WIN_SRC_SANDBOX_POLICY_BASE_H_ | 6 #define SANDBOX_WIN_SRC_SANDBOX_POLICY_BASE_H_ |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 | 9 |
10 #include <list> | 10 #include <list> |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 // We act as a policy dispatcher, implementing the handler for the "ping" IPC, | 31 // We act as a policy dispatcher, implementing the handler for the "ping" IPC, |
32 // so we have to provide the appropriate handler on the OnMessageReady method. | 32 // so we have to provide the appropriate handler on the OnMessageReady method. |
33 // There is a static_cast for the handler, and the compiler only performs the | 33 // There is a static_cast for the handler, and the compiler only performs the |
34 // cast if the first base class is Dispatcher. | 34 // cast if the first base class is Dispatcher. |
35 class PolicyBase : public Dispatcher, public TargetPolicy { | 35 class PolicyBase : public Dispatcher, public TargetPolicy { |
36 public: | 36 public: |
37 PolicyBase(); | 37 PolicyBase(); |
38 | 38 |
39 // TargetPolicy: | 39 // TargetPolicy: |
40 virtual void AddRef() OVERRIDE; | 40 virtual void AddRef() override; |
41 virtual void Release() OVERRIDE; | 41 virtual void Release() override; |
42 virtual ResultCode SetTokenLevel(TokenLevel initial, | 42 virtual ResultCode SetTokenLevel(TokenLevel initial, |
43 TokenLevel lockdown) OVERRIDE; | 43 TokenLevel lockdown) override; |
44 virtual TokenLevel GetInitialTokenLevel() const OVERRIDE; | 44 virtual TokenLevel GetInitialTokenLevel() const override; |
45 virtual TokenLevel GetLockdownTokenLevel() const OVERRIDE; | 45 virtual TokenLevel GetLockdownTokenLevel() const override; |
46 virtual ResultCode SetJobLevel(JobLevel job_level, | 46 virtual ResultCode SetJobLevel(JobLevel job_level, |
47 uint32 ui_exceptions) OVERRIDE; | 47 uint32 ui_exceptions) override; |
48 virtual ResultCode SetJobMemoryLimit(size_t memory_limit) OVERRIDE; | 48 virtual ResultCode SetJobMemoryLimit(size_t memory_limit) override; |
49 virtual ResultCode SetAlternateDesktop(bool alternate_winstation) OVERRIDE; | 49 virtual ResultCode SetAlternateDesktop(bool alternate_winstation) override; |
50 virtual base::string16 GetAlternateDesktop() const OVERRIDE; | 50 virtual base::string16 GetAlternateDesktop() const override; |
51 virtual ResultCode CreateAlternateDesktop(bool alternate_winstation) OVERRIDE; | 51 virtual ResultCode CreateAlternateDesktop(bool alternate_winstation) override; |
52 virtual void DestroyAlternateDesktop() OVERRIDE; | 52 virtual void DestroyAlternateDesktop() override; |
53 virtual ResultCode SetIntegrityLevel(IntegrityLevel integrity_level) OVERRIDE; | 53 virtual ResultCode SetIntegrityLevel(IntegrityLevel integrity_level) override; |
54 virtual IntegrityLevel GetIntegrityLevel() const OVERRIDE; | 54 virtual IntegrityLevel GetIntegrityLevel() const override; |
55 virtual ResultCode SetDelayedIntegrityLevel( | 55 virtual ResultCode SetDelayedIntegrityLevel( |
56 IntegrityLevel integrity_level) OVERRIDE; | 56 IntegrityLevel integrity_level) override; |
57 virtual ResultCode SetAppContainer(const wchar_t* sid) OVERRIDE; | 57 virtual ResultCode SetAppContainer(const wchar_t* sid) override; |
58 virtual ResultCode SetCapability(const wchar_t* sid) OVERRIDE; | 58 virtual ResultCode SetCapability(const wchar_t* sid) override; |
59 virtual ResultCode SetProcessMitigations(MitigationFlags flags) OVERRIDE; | 59 virtual ResultCode SetProcessMitigations(MitigationFlags flags) override; |
60 virtual MitigationFlags GetProcessMitigations() OVERRIDE; | 60 virtual MitigationFlags GetProcessMitigations() override; |
61 virtual ResultCode SetDelayedProcessMitigations( | 61 virtual ResultCode SetDelayedProcessMitigations( |
62 MitigationFlags flags) OVERRIDE; | 62 MitigationFlags flags) override; |
63 virtual MitigationFlags GetDelayedProcessMitigations() const OVERRIDE; | 63 virtual MitigationFlags GetDelayedProcessMitigations() const override; |
64 virtual void SetStrictInterceptions() OVERRIDE; | 64 virtual void SetStrictInterceptions() override; |
65 virtual ResultCode SetStdoutHandle(HANDLE handle) OVERRIDE; | 65 virtual ResultCode SetStdoutHandle(HANDLE handle) override; |
66 virtual ResultCode SetStderrHandle(HANDLE handle) OVERRIDE; | 66 virtual ResultCode SetStderrHandle(HANDLE handle) override; |
67 virtual ResultCode AddRule(SubSystem subsystem, Semantics semantics, | 67 virtual ResultCode AddRule(SubSystem subsystem, Semantics semantics, |
68 const wchar_t* pattern) OVERRIDE; | 68 const wchar_t* pattern) override; |
69 virtual ResultCode AddDllToUnload(const wchar_t* dll_name); | 69 virtual ResultCode AddDllToUnload(const wchar_t* dll_name); |
70 virtual ResultCode AddKernelObjectToClose( | 70 virtual ResultCode AddKernelObjectToClose( |
71 const base::char16* handle_type, | 71 const base::char16* handle_type, |
72 const base::char16* handle_name) OVERRIDE; | 72 const base::char16* handle_name) override; |
73 | 73 |
74 // Dispatcher: | 74 // Dispatcher: |
75 virtual Dispatcher* OnMessageReady(IPCParams* ipc, | 75 virtual Dispatcher* OnMessageReady(IPCParams* ipc, |
76 CallbackGeneric* callback) OVERRIDE; | 76 CallbackGeneric* callback) override; |
77 virtual bool SetupService(InterceptionManager* manager, int service) OVERRIDE; | 77 virtual bool SetupService(InterceptionManager* manager, int service) override; |
78 | 78 |
79 // Creates a Job object with the level specified in a previous call to | 79 // Creates a Job object with the level specified in a previous call to |
80 // SetJobLevel(). | 80 // SetJobLevel(). |
81 ResultCode MakeJobObject(HANDLE* job); | 81 ResultCode MakeJobObject(HANDLE* job); |
82 | 82 |
83 // Creates the two tokens with the levels specified in a previous call to | 83 // Creates the two tokens with the levels specified in a previous call to |
84 // SetTokenLevel(). | 84 // SetTokenLevel(). |
85 ResultCode MakeTokens(HANDLE* initial, HANDLE* lockdown); | 85 ResultCode MakeTokens(HANDLE* initial, HANDLE* lockdown); |
86 | 86 |
87 const AppContainerAttributes* GetAppContainer(); | 87 const AppContainerAttributes* GetAppContainer(); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 static HDESK alternate_desktop_handle_; | 162 static HDESK alternate_desktop_handle_; |
163 static HWINSTA alternate_winstation_handle_; | 163 static HWINSTA alternate_winstation_handle_; |
164 static IntegrityLevel alternate_desktop_integrity_level_label_; | 164 static IntegrityLevel alternate_desktop_integrity_level_label_; |
165 | 165 |
166 DISALLOW_COPY_AND_ASSIGN(PolicyBase); | 166 DISALLOW_COPY_AND_ASSIGN(PolicyBase); |
167 }; | 167 }; |
168 | 168 |
169 } // namespace sandbox | 169 } // namespace sandbox |
170 | 170 |
171 #endif // SANDBOX_WIN_SRC_SANDBOX_POLICY_BASE_H_ | 171 #endif // SANDBOX_WIN_SRC_SANDBOX_POLICY_BASE_H_ |
OLD | NEW |