OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #include <stdio.h> | 5 #include <stdio.h> |
6 #include <windows.h> | 6 #include <windows.h> |
7 #include "sandbox/win/src/sandbox.h" | 7 #include "sandbox/win/src/sandbox.h" |
8 #include "sandbox/win/src/sandbox_factory.h" | 8 #include "sandbox/win/src/sandbox_factory.h" |
9 #include "sandbox/win/src/broker_services.h" | 9 #include "sandbox/win/src/broker_services.h" |
10 #include "sandbox/win/src/target_services.h" | 10 #include "sandbox/win/src/target_services.h" |
11 | 11 |
12 namespace sandbox { | 12 namespace sandbox { |
13 // The section for IPC and policy. | 13 // The section for IPC and policy. |
14 SANDBOX_INTERCEPT HANDLE g_shared_section = NULL; | 14 SANDBOX_INTERCEPT HANDLE g_shared_section; |
15 | 15 |
16 static bool s_is_broker = false; | 16 static bool s_is_broker = false; |
17 | 17 |
18 // GetBrokerServices: the current implementation relies on a shared section | 18 // GetBrokerServices: the current implementation relies on a shared section |
19 // that is created by the broker and opened by the target. | 19 // that is created by the broker and opened by the target. |
20 BrokerServices* SandboxFactory::GetBrokerServices() { | 20 BrokerServices* SandboxFactory::GetBrokerServices() { |
21 // Can't be the broker if the shared section is open. | 21 // Can't be the broker if the shared section is open. |
22 if (NULL != g_shared_section) { | 22 if (NULL != g_shared_section) { |
23 return NULL; | 23 return NULL; |
24 } | 24 } |
(...skipping 10 matching lines...) Expand all Loading... |
35 if (NULL == g_shared_section) { | 35 if (NULL == g_shared_section) { |
36 return NULL; | 36 return NULL; |
37 } | 37 } |
38 // We are the target | 38 // We are the target |
39 s_is_broker = false; | 39 s_is_broker = false; |
40 // Creates and returns the target services implementation. | 40 // Creates and returns the target services implementation. |
41 return TargetServicesBase::GetInstance(); | 41 return TargetServicesBase::GetInstance(); |
42 } | 42 } |
43 | 43 |
44 } // namespace sandbox | 44 } // namespace sandbox |
OLD | NEW |