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 PPAPI_HOST_RESOURCE_HOST_H_ | 5 #ifndef PPAPI_HOST_RESOURCE_HOST_H_ |
6 #define PPAPI_HOST_RESOURCE_HOST_H_ | 6 #define PPAPI_HOST_RESOURCE_HOST_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 // This runs any message filters in |message_filters_|. If the message is not | 40 // This runs any message filters in |message_filters_|. If the message is not |
41 // handled by these filters then the host's own message handler is run. True | 41 // handled by these filters then the host's own message handler is run. True |
42 // is always returned (the message will always be handled in some way). | 42 // is always returned (the message will always be handled in some way). |
43 virtual bool HandleMessage(const IPC::Message& msg, | 43 virtual bool HandleMessage(const IPC::Message& msg, |
44 HostMessageContext* context) OVERRIDE; | 44 HostMessageContext* context) OVERRIDE; |
45 | 45 |
46 virtual void SendReply(const ReplyMessageContext& context, | 46 virtual void SendReply(const ReplyMessageContext& context, |
47 const IPC::Message& msg) OVERRIDE; | 47 const IPC::Message& msg) OVERRIDE; |
48 | 48 |
| 49 virtual bool IsGraphics2DHost() const { return false; } |
| 50 |
49 protected: | 51 protected: |
50 // Adds a ResourceMessageFilter to handle resource messages. Incoming | 52 // Adds a ResourceMessageFilter to handle resource messages. Incoming |
51 // messages will be passed to the handlers of these filters before being | 53 // messages will be passed to the handlers of these filters before being |
52 // handled by the resource host's own message handler. This allows | 54 // handled by the resource host's own message handler. This allows |
53 // ResourceHosts to easily handle messages on other threads. | 55 // ResourceHosts to easily handle messages on other threads. |
54 void AddFilter(scoped_refptr<ResourceMessageFilter> filter); | 56 void AddFilter(scoped_refptr<ResourceMessageFilter> filter); |
55 | 57 |
56 private: | 58 private: |
57 // The host that owns this object. | 59 // The host that owns this object. |
58 PpapiHost* host_; | 60 PpapiHost* host_; |
59 | 61 |
60 PP_Instance pp_instance_; | 62 PP_Instance pp_instance_; |
61 PP_Resource pp_resource_; | 63 PP_Resource pp_resource_; |
62 | 64 |
63 // A vector of message filters which the host will forward incoming resource | 65 // A vector of message filters which the host will forward incoming resource |
64 // messages to. | 66 // messages to. |
65 std::vector<scoped_refptr<ResourceMessageFilter> > message_filters_; | 67 std::vector<scoped_refptr<ResourceMessageFilter> > message_filters_; |
66 | 68 |
67 DISALLOW_COPY_AND_ASSIGN(ResourceHost); | 69 DISALLOW_COPY_AND_ASSIGN(ResourceHost); |
68 }; | 70 }; |
69 | 71 |
70 } // namespace host | 72 } // namespace host |
71 } // namespace ppapi | 73 } // namespace ppapi |
72 | 74 |
73 #endif // PPAPI_HOST_RESOURCE_HOST_H_ | 75 #endif // PPAPI_HOST_RESOURCE_HOST_H_ |
OLD | NEW |