OLD | NEW |
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 IPC_IPC_MESSAGE_H_ | 5 #ifndef IPC_IPC_MESSAGE_H_ |
6 #define IPC_IPC_MESSAGE_H_ | 6 #define IPC_IPC_MESSAGE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 class Channel; | 36 class Channel; |
37 class Message; | 37 class Message; |
38 struct LogData; | 38 struct LogData; |
39 | 39 |
40 class IPC_EXPORT Message : public Pickle { | 40 class IPC_EXPORT Message : public Pickle { |
41 public: | 41 public: |
42 // Implemented by objects that can send IPC messages across a channel. | 42 // Implemented by objects that can send IPC messages across a channel. |
43 class IPC_EXPORT Sender { | 43 class IPC_EXPORT Sender { |
44 public: | 44 public: |
45 virtual ~Sender() {} | |
46 | |
47 // Sends the given IPC message. The implementor takes ownership of the | 45 // Sends the given IPC message. The implementor takes ownership of the |
48 // given Message regardless of whether or not this method succeeds. This | 46 // given Message regardless of whether or not this method succeeds. This |
49 // is done to make this method easier to use. Returns true on success and | 47 // is done to make this method easier to use. Returns true on success and |
50 // false otherwise. | 48 // false otherwise. |
51 virtual bool Send(Message* msg) = 0; | 49 virtual bool Send(Message* msg) = 0; |
| 50 |
| 51 protected: |
| 52 virtual ~Sender() {} |
52 }; | 53 }; |
53 | 54 |
54 enum PriorityValue { | 55 enum PriorityValue { |
55 PRIORITY_LOW = 1, | 56 PRIORITY_LOW = 1, |
56 PRIORITY_NORMAL, | 57 PRIORITY_NORMAL, |
57 PRIORITY_HIGH | 58 PRIORITY_HIGH |
58 }; | 59 }; |
59 | 60 |
60 // Bit values used in the flags field. | 61 // Bit values used in the flags field. |
61 enum { | 62 enum { |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 MSG_ROUTING_NONE = -2, | 283 MSG_ROUTING_NONE = -2, |
283 | 284 |
284 // indicates a general message not sent to a particular tab. | 285 // indicates a general message not sent to a particular tab. |
285 MSG_ROUTING_CONTROL = kint32max, | 286 MSG_ROUTING_CONTROL = kint32max, |
286 }; | 287 }; |
287 | 288 |
288 #define IPC_REPLY_ID 0xFFFFFFF0 // Special message id for replies | 289 #define IPC_REPLY_ID 0xFFFFFFF0 // Special message id for replies |
289 #define IPC_LOGGING_ID 0xFFFFFFF1 // Special message id for logging | 290 #define IPC_LOGGING_ID 0xFFFFFFF1 // Special message id for logging |
290 | 291 |
291 #endif // IPC_IPC_MESSAGE_H_ | 292 #endif // IPC_IPC_MESSAGE_H_ |
OLD | NEW |