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

Side by Side Diff: ppapi/host/ppapi_host.h

Issue 11053003: Migrate Graphics2D to new design. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 2 months 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
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 PPAPI_HOST_PPAPI_HOST_H_ 5 #ifndef PPAPI_HOST_PPAPI_HOST_H_
6 #define PPAPI_HOST_PPAPI_HOST_H_ 6 #define PPAPI_HOST_PPAPI_HOST_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set>
9 10
10 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
11 #include "base/memory/linked_ptr.h" 12 #include "base/memory/linked_ptr.h"
12 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
13 #include "base/memory/scoped_vector.h" 14 #include "base/memory/scoped_vector.h"
14 #include "base/observer_list.h" 15 #include "base/observer_list.h"
15 #include "ipc/ipc_listener.h" 16 #include "ipc/ipc_listener.h"
16 #include "ipc/ipc_sender.h" 17 #include "ipc/ipc_sender.h"
17 #include "ppapi/c/pp_instance.h" 18 #include "ppapi/c/pp_instance.h"
18 #include "ppapi/c/pp_resource.h" 19 #include "ppapi/c/pp_resource.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 const IPC::Message& msg); 60 const IPC::Message& msg);
60 61
61 // Adds the given host factory filter to the host. The PpapiHost will take 62 // Adds the given host factory filter to the host. The PpapiHost will take
62 // ownership of the pointer. 63 // ownership of the pointer.
63 void AddHostFactoryFilter(scoped_ptr<HostFactory> filter); 64 void AddHostFactoryFilter(scoped_ptr<HostFactory> filter);
64 65
65 // Adds the given message filter to the host. The PpapiHost will take 66 // Adds the given message filter to the host. The PpapiHost will take
66 // ownership of the pointer. 67 // ownership of the pointer.
67 void AddInstanceMessageFilter(scoped_ptr<InstanceMessageFilter> filter); 68 void AddInstanceMessageFilter(scoped_ptr<InstanceMessageFilter> filter);
68 69
70 // Returns null if the resource doesn't exist.
71 host::ResourceHost* GetResourceHost(PP_Resource resource) const;
72
69 private: 73 private:
70 friend class InstanceMessageFilter; 74 friend class InstanceMessageFilter;
71 75
72 void HandleResourceCall( 76 void HandleResourceCall(
73 const proxy::ResourceMessageCallParams& params, 77 const proxy::ResourceMessageCallParams& params,
74 const IPC::Message& nested_msg, 78 const IPC::Message& nested_msg,
75 HostMessageContext* context); 79 HostMessageContext* context);
76 80
77 // Message handlers. 81 // Message handlers.
78 void OnHostMsgResourceCall(const proxy::ResourceMessageCallParams& params, 82 void OnHostMsgResourceCall(const proxy::ResourceMessageCallParams& params,
79 const IPC::Message& nested_msg); 83 const IPC::Message& nested_msg);
80 void OnHostMsgResourceSyncCall( 84 void OnHostMsgResourceSyncCall(
81 const proxy::ResourceMessageCallParams& params, 85 const proxy::ResourceMessageCallParams& params,
82 const IPC::Message& nested_msg, 86 const IPC::Message& nested_msg,
83 IPC::Message* reply_msg); 87 IPC::Message* reply_msg);
84 void OnHostMsgResourceCreated(const proxy::ResourceMessageCallParams& param, 88 void OnHostMsgResourceCreated(const proxy::ResourceMessageCallParams& param,
85 PP_Instance instance, 89 PP_Instance instance,
86 const IPC::Message& nested_msg); 90 const IPC::Message& nested_msg);
87 void OnHostMsgResourceDestroyed(PP_Resource resource); 91 void OnHostMsgResourceDestroyed(PP_Resource resource);
88 92
89 // Returns null if the resource doesn't exist.
90 host::ResourceHost* GetResourceHost(PP_Resource resource);
91
92 // Non-owning pointer. 93 // Non-owning pointer.
93 IPC::Sender* sender_; 94 IPC::Sender* sender_;
94 95
95 PpapiPermissions permissions_; 96 PpapiPermissions permissions_;
96 97
97 // Filters for resource creation messages. Note that since we don't support 98 // Filters for resource creation messages. Note that since we don't support
98 // deleting these dynamically we don't need to worry about modifications 99 // deleting these dynamically we don't need to worry about modifications
99 // during iteration. If we add that capability, this should be replaced with 100 // during iteration. If we add that capability, this should be replaced with
100 // an ObserverList. 101 // an ObserverList.
101 ScopedVector<HostFactory> host_factory_filters_; 102 ScopedVector<HostFactory> host_factory_filters_;
102 103
103 // Filters for instance messages. Note that since we don't support deleting 104 // Filters for instance messages. Note that since we don't support deleting
104 // these dynamically we don't need to worry about modifications during 105 // these dynamically we don't need to worry about modifications during
105 // iteration. If we add that capability, this should be replaced with an 106 // iteration. If we add that capability, this should be replaced with an
106 // ObserverList. 107 // ObserverList.
107 ScopedVector<InstanceMessageFilter> instance_message_filters_; 108 ScopedVector<InstanceMessageFilter> instance_message_filters_;
108 109
109 typedef std::map<PP_Resource, linked_ptr<ResourceHost> > ResourceMap; 110 typedef std::map<PP_Resource, linked_ptr<ResourceHost> > ResourceMap;
110 ResourceMap resources_; 111 ResourceMap resources_;
111 112
112 DISALLOW_COPY_AND_ASSIGN(PpapiHost); 113 DISALLOW_COPY_AND_ASSIGN(PpapiHost);
113 }; 114 };
114 115
115 } // namespace host 116 } // namespace host
116 } // namespace ppapi 117 } // namespace ppapi
117 118
118 #endif // PPAPI_HOST_PPAPIE_HOST_H_ 119 #endif // PPAPI_HOST_PPAPIE_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698