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

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

Issue 1378523002: Use scoped_refptr and RefCountedThreadSafe for TargetPolicy. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated patchset dependency Created 5 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 | « content/common/sandbox_win.cc ('k') | sandbox/win/src/broker_services.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 (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>
11 #include <utility> 11 #include <utility>
12
12 #include "base/basictypes.h" 13 #include "base/basictypes.h"
13 #include "base/compiler_specific.h" 14 #include "base/compiler_specific.h"
15 #include "base/memory/ref_counted.h"
14 #include "base/win/scoped_handle.h" 16 #include "base/win/scoped_handle.h"
15 #include "sandbox/win/src/crosscall_server.h" 17 #include "sandbox/win/src/crosscall_server.h"
16 #include "sandbox/win/src/job.h" 18 #include "sandbox/win/src/job.h"
17 #include "sandbox/win/src/sandbox.h" 19 #include "sandbox/win/src/sandbox.h"
18 #include "sandbox/win/src/sharedmem_ipc_server.h" 20 #include "sandbox/win/src/sharedmem_ipc_server.h"
19 #include "sandbox/win/src/win2k_threadpool.h" 21 #include "sandbox/win/src/win2k_threadpool.h"
20 #include "sandbox/win/src/win_utils.h" 22 #include "sandbox/win/src/win_utils.h"
21 23
22 namespace { 24 namespace {
23 25
(...skipping 13 matching lines...) Expand all
37 // collection of the former. 39 // collection of the former.
38 class BrokerServicesBase final : public BrokerServices, 40 class BrokerServicesBase final : public BrokerServices,
39 public SingletonBase<BrokerServicesBase> { 41 public SingletonBase<BrokerServicesBase> {
40 public: 42 public:
41 BrokerServicesBase(); 43 BrokerServicesBase();
42 44
43 ~BrokerServicesBase(); 45 ~BrokerServicesBase();
44 46
45 // BrokerServices interface. 47 // BrokerServices interface.
46 ResultCode Init() override; 48 ResultCode Init() override;
47 TargetPolicy* CreatePolicy() override; 49 scoped_refptr<TargetPolicy> CreatePolicy() override;
48 ResultCode SpawnTarget(const wchar_t* exe_path, 50 ResultCode SpawnTarget(const wchar_t* exe_path,
49 const wchar_t* command_line, 51 const wchar_t* command_line,
50 TargetPolicy* policy, 52 scoped_refptr<TargetPolicy> policy,
51 PROCESS_INFORMATION* target) override; 53 PROCESS_INFORMATION* target) override;
52 ResultCode WaitForAllTargets() override; 54 ResultCode WaitForAllTargets() override;
53 ResultCode AddTargetPeer(HANDLE peer_process) override; 55 ResultCode AddTargetPeer(HANDLE peer_process) override;
54 ResultCode InstallAppContainer(const wchar_t* sid, 56 ResultCode InstallAppContainer(const wchar_t* sid,
55 const wchar_t* name) override; 57 const wchar_t* name) override;
56 ResultCode UninstallAppContainer(const wchar_t* sid) override; 58 ResultCode UninstallAppContainer(const wchar_t* sid) override;
57 59
58 // 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
59 // target processes 61 // target processes
60 // Returns: 62 // Returns:
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 // job. Consult |jobless_process_handles_| for handles of pocess without job. 103 // job. Consult |jobless_process_handles_| for handles of pocess without job.
102 std::set<DWORD> child_process_ids_; 104 std::set<DWORD> child_process_ids_;
103 105
104 DISALLOW_COPY_AND_ASSIGN(BrokerServicesBase); 106 DISALLOW_COPY_AND_ASSIGN(BrokerServicesBase);
105 }; 107 };
106 108
107 } // namespace sandbox 109 } // namespace sandbox
108 110
109 111
110 #endif // SANDBOX_WIN_SRC_BROKER_SERVICES_H_ 112 #endif // SANDBOX_WIN_SRC_BROKER_SERVICES_H_
OLDNEW
« no previous file with comments | « content/common/sandbox_win.cc ('k') | sandbox/win/src/broker_services.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698