OLD | NEW |
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 IPC_HANDLE_WIN_H_ | 5 #ifndef IPC_HANDLE_WIN_H_ |
6 #define IPC_HANDLE_WIN_H_ | 6 #define IPC_HANDLE_WIN_H_ |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 | 9 |
| 10 #include <string> |
| 11 |
10 #include "ipc/ipc_export.h" | 12 #include "ipc/ipc_export.h" |
11 #include "ipc/ipc_message_macros.h" | 13 #include "ipc/ipc_param_traits.h" |
| 14 |
| 15 namespace base { |
| 16 class PickleIterator; |
| 17 } // namespace base |
12 | 18 |
13 namespace IPC { | 19 namespace IPC { |
14 | 20 |
| 21 class Message; |
| 22 |
15 // HandleWin is a wrapper around a Windows HANDLE that can be transported | 23 // HandleWin is a wrapper around a Windows HANDLE that can be transported |
16 // across Chrome IPC channels that support attachment brokering. The HANDLE will | 24 // across Chrome IPC channels that support attachment brokering. The HANDLE will |
17 // be duplicated into the destination process. | 25 // be duplicated into the destination process. |
18 class IPC_EXPORT HandleWin { | 26 class IPC_EXPORT HandleWin { |
19 public: | 27 public: |
20 enum Permissions { | 28 enum Permissions { |
21 // A placeholder value to be used by the receiving IPC channel, since the | 29 // A placeholder value to be used by the receiving IPC channel, since the |
22 // permissions information is only used by the broker process. | 30 // permissions information is only used by the broker process. |
23 INVALID, | 31 INVALID, |
24 // The new HANDLE will have the same permissions as the old HANDLE. | 32 // The new HANDLE will have the same permissions as the old HANDLE. |
(...skipping 20 matching lines...) Expand all Loading... |
45 struct IPC_EXPORT ParamTraits<HandleWin> { | 53 struct IPC_EXPORT ParamTraits<HandleWin> { |
46 typedef HandleWin param_type; | 54 typedef HandleWin param_type; |
47 static void Write(Message* m, const param_type& p); | 55 static void Write(Message* m, const param_type& p); |
48 static bool Read(const Message* m, base::PickleIterator* iter, param_type* p); | 56 static bool Read(const Message* m, base::PickleIterator* iter, param_type* p); |
49 static void Log(const param_type& p, std::string* l); | 57 static void Log(const param_type& p, std::string* l); |
50 }; | 58 }; |
51 | 59 |
52 } // namespace IPC | 60 } // namespace IPC |
53 | 61 |
54 #endif // IPC_HANDLE_WIN_H_ | 62 #endif // IPC_HANDLE_WIN_H_ |
OLD | NEW |