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

Side by Side Diff: sandbox/win/src/top_level_dispatcher.h

Issue 1849323003: Convert //sandbox to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixup nonsfi_sandbox_unittest.cc Created 4 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
« no previous file with comments | « sandbox/win/src/target_process.cc ('k') | sandbox/win/src/top_level_dispatcher.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_SRC_TOP_LEVEL_DISPATCHER_H__ 5 #ifndef SANDBOX_SRC_TOP_LEVEL_DISPATCHER_H__
6 #define SANDBOX_SRC_TOP_LEVEL_DISPATCHER_H__ 6 #define SANDBOX_SRC_TOP_LEVEL_DISPATCHER_H__
7 7
8 #include <memory>
9
8 #include "base/macros.h" 10 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "sandbox/win/src/crosscall_server.h" 11 #include "sandbox/win/src/crosscall_server.h"
11 #include "sandbox/win/src/interception.h" 12 #include "sandbox/win/src/interception.h"
12 #include "sandbox/win/src/ipc_tags.h" 13 #include "sandbox/win/src/ipc_tags.h"
13 #include "sandbox/win/src/sandbox_policy_base.h" 14 #include "sandbox/win/src/sandbox_policy_base.h"
14 15
15 namespace sandbox { 16 namespace sandbox {
16 17
17 // Top level dispatcher which hands requests to the appropriate service 18 // Top level dispatcher which hands requests to the appropriate service
18 // dispatchers. 19 // dispatchers.
19 class TopLevelDispatcher : public Dispatcher { 20 class TopLevelDispatcher : public Dispatcher {
20 public: 21 public:
21 // |policy| must outlive this class. 22 // |policy| must outlive this class.
22 explicit TopLevelDispatcher(PolicyBase* policy); 23 explicit TopLevelDispatcher(PolicyBase* policy);
23 ~TopLevelDispatcher() override; 24 ~TopLevelDispatcher() override;
24 25
25 Dispatcher* OnMessageReady(IPCParams* ipc, 26 Dispatcher* OnMessageReady(IPCParams* ipc,
26 CallbackGeneric* callback) override; 27 CallbackGeneric* callback) override;
27 bool SetupService(InterceptionManager* manager, int service) override; 28 bool SetupService(InterceptionManager* manager, int service) override;
28 29
29 private: 30 private:
30 // Test IPC provider. 31 // Test IPC provider.
31 bool Ping(IPCInfo* ipc, void* cookie); 32 bool Ping(IPCInfo* ipc, void* cookie);
32 33
33 // Returns a dispatcher from ipc_targets_. 34 // Returns a dispatcher from ipc_targets_.
34 Dispatcher* GetDispatcher(int ipc_tag); 35 Dispatcher* GetDispatcher(int ipc_tag);
35 36
36 PolicyBase* policy_; 37 PolicyBase* policy_;
37 scoped_ptr<Dispatcher> filesystem_dispatcher_; 38 std::unique_ptr<Dispatcher> filesystem_dispatcher_;
38 scoped_ptr<Dispatcher> named_pipe_dispatcher_; 39 std::unique_ptr<Dispatcher> named_pipe_dispatcher_;
39 scoped_ptr<Dispatcher> thread_process_dispatcher_; 40 std::unique_ptr<Dispatcher> thread_process_dispatcher_;
40 scoped_ptr<Dispatcher> sync_dispatcher_; 41 std::unique_ptr<Dispatcher> sync_dispatcher_;
41 scoped_ptr<Dispatcher> registry_dispatcher_; 42 std::unique_ptr<Dispatcher> registry_dispatcher_;
42 scoped_ptr<Dispatcher> handle_dispatcher_; 43 std::unique_ptr<Dispatcher> handle_dispatcher_;
43 scoped_ptr<Dispatcher> process_mitigations_win32k_dispatcher_; 44 std::unique_ptr<Dispatcher> process_mitigations_win32k_dispatcher_;
44 Dispatcher* ipc_targets_[IPC_LAST_TAG]; 45 Dispatcher* ipc_targets_[IPC_LAST_TAG];
45 46
46 DISALLOW_COPY_AND_ASSIGN(TopLevelDispatcher); 47 DISALLOW_COPY_AND_ASSIGN(TopLevelDispatcher);
47 }; 48 };
48 49
49 } // namespace sandbox 50 } // namespace sandbox
50 51
51 #endif // SANDBOX_SRC_TOP_LEVEL_DISPATCHER_H__ 52 #endif // SANDBOX_SRC_TOP_LEVEL_DISPATCHER_H__
OLDNEW
« no previous file with comments | « sandbox/win/src/target_process.cc ('k') | sandbox/win/src/top_level_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698